Skip to content

Instantly share code, notes, and snippets.

@magnetikonline
Created June 3, 2019 01:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magnetikonline/01fef2e47147dc519e476da0af5f356a to your computer and use it in GitHub Desktop.
Save magnetikonline/01fef2e47147dc519e476da0af5f356a to your computer and use it in GitHub Desktop.
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