Read more

Git: Amending older commits

Tobias Kraze
December 03, 2010Software engineer at makandra GmbH

Lets say you need to make a change to a commit OLD_COMMIT, but this is not the most recent. If you have neither pushed nor merged it, you can do this:

  • Make a new commit now, with a message like "fix".
  • Do a
git rebase -i OLD_COMMIT~
  • In the editor window that opened, move the "fix" commit directly after the one you want to amend (so it should be the second from the top), and mark it as "fixup". Save the file.
  • If there are conflicts, solve them, add them, and do
git rebase --continue
Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot
Posted by Tobias Kraze to makandra dev (2010-12-03 11:56)