我已经使用 Git扩展了一段时间(太棒了!),但是我没有找到以下简单的答案:
有时,在键入提交消息时,会打错字。我的 friend 向我展示了如何通过以下方法(在Git Extensions中)进行修复:
然后,我只需选中“修改”框,然后重写我的信息即可!我的提交消息是固定的。
但是,另一个选项“Squash commit”……我一直想知道它做什么?!
我的问题是:
有人可以简单地解释一下 Git / Git扩展中的壁球提交和 Fixup提交之间的确切区别是什么?它们看起来与我“相似”:
最佳答案
我不知道Git Extensions专门做什么,但是git rebase
有一个选项可以自动压扁或用压扁修正提交!或修正!前缀,分别为:
--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).
squash和fixup之间的区别在于,在重新设置基准期间,
squash
操作将提示您合并原始和squash提交的消息,而fixup
操作将保留原始消息,并从fixup提交中丢弃该消息。