Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Git correct a commit via --fixup

Git correct a commit via --fixup

Initial commit state:

$ git log --oneline
733e2ff Second widget done
fb2f677 First widget done
ac5db87 First commit

But... turns out we have an error in fb2f677 First widget done. Lets fix it, then commit:

git commit --fixup fb2f677

Now list git log:

$ git log --oneline
c5069d5 fixup! First widget done
733e2ff Second widget done
fb2f677 First widget done
ac5db87 First commit

And finally merge c5069d5 into fb2f677:

$ git rebase --autosquash --interactive ac5db87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.