What's the difference between "squash" and "fixup" in Git/Git Extension?

I do not know what Git Extensions does with it specifically, but git rebase has an option to automatically squash or fixup commits with squash! or fixup! prefixes, respectively:

   --autosquash, --no-autosquash
       When the commit log message begins with "squash! ..." (or "fixup!
       ..."), and there is a commit whose title begins with the same ...,
       automatically modify the todo list of rebase -i so that the commit
       marked for squashing comes right after the commit to be modified,
       and change the action of the moved commit from pick to squash (or
       fixup).

The difference between squash and fixup is that during the rebase, the squash operation will prompt you to combine the messages of the original and the squash commit, whereas the fixup operation will keep the original message and discard the message from the fixup commit.


Simply put, when rebasing a series of commits, each commit marked as a squash, gives you the opportunity to use its message as part of a pick or reword commit message.

When you use fixup the message from that commit is discarded.


If the question is what's the difference between squash and fixup in git when doing git rebase --interactive, then the answer is the commit message.

s, squash <commit> = use commit, but meld into previous commit

f, fixup <commit> = like "squash", but discard this commit's log message


For example:

pick 22a4667 father commit message
squash 46d7c0d child commit message # case 1
# fixup 46d7c0d child commit message # case 2

The commit message after rebasing in case 1 would be:

father commit message

child commit message

while the commit message in case 2 is:

father commit message
# no sub messages