You can also use git commit --fixup <hash> to prepare a fixup (or squash using --squash). They will be added on top of your branch so you still have to do a rebase using git rebase -i --autosquash to do the fixup or squash. I use this a lot to quickly fix PR review comments or mistakes I made along the way.
Very useful when you're using cli to commit with a message, but the commit message turns out too long so you shorten it, then can go to --amend --no-edit to extrapolate on the initial brief commit message. This is my most common use for this.
My second is forgetting to mention a change in a commit.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You can also use
git commit --fixup <hash>
to prepare a fixup (or squash using --squash). They will be added on top of your branch so you still have to do a rebase usinggit rebase -i --autosquash
to do the fixup or squash. I use this a lot to quickly fix PR review comments or mistakes I made along the way.git commit --amend --no-edit
is also useful in such cases, which simply adds your changes to previous commit,
Yup, but that only goes for the last commit whereas a fixup can blend into any commit after a rebase.
Really neat, I didn't understand initially what it is
Very useful when you're using cli to commit with a message, but the commit message turns out too long so you shorten it, then can go to --amend --no-edit to extrapolate on the initial brief commit message. This is my most common use for this.
My second is forgetting to mention a change in a commit.