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

前端 未结 6 1930
夕颜
夕颜 2020-12-07 15:14

I\'ve been using Git Extensions for a while now (it\'s awesome!) but I haven\'t found a simple answer to the following:

Sometimes, when typing a com

6条回答
  •  抹茶落季
    2020-12-07 15:46

    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.

提交回复
热议问题