git rebase: difference between squash and fixup

2020-08-17

 | 

~1 min read

 | 

141 words

The more I get into interactive rebases, the more questions I have about how all of the options work. In particular, one question I wasn’t totally clear on was the difference between a squash and a fixup. After all, the outcome for the diff is the same: the two commits are combined.

The difference, then, between a Squash and a Fixup in a rebase, is in relation to the commit message. Not the body of the diff.

When rebasing, a Squash commit will open an editor and prompt you to combine the two commit messages:the original commit and the squash commit. In contrast, during a rebase, the Fixup commit message will be discarded in favor of the original commit as the two commits are merged into one.

Credit to drizzd and Ricardo for the insight, per this answer on Stack Overflow.


Related Posts
  • Git Commit: Fixup And Squash Automatically


  • Hi there and thanks for reading! My name's Stephen. I live in Chicago with my wife, Kate, and dog, Finn. Want more? See about and get in touch!