我使用 Git Extensions 已经有一段时间了(太棒了!)但我还没有找到以下问题的简单答案:
有时,在输入提交消息时,会出现打字错误。我的 friend 向我展示了如何通过以下方式修复它(在 Git Extentions 中):
Right-Click on the commit > Advanced > Fixup commit
然后我只需选中“修改”框并重写我的消息,瞧!我的提交消息已修复。
但是这个其他选项“Squash commit”...我一直想知道它的作用是什么?!
我的问题是:
有人能简单地解释一下 Git/Git Extensions 中 Squash commit 和 Fixup commit 之间的确切区别是什么吗?它们对我来说有点……“相似”:
最佳答案
我不知道 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 之间的区别在于,在 rebase 期间,squash
操作会提示您 merge 原始消息和 squash 提交的消息,而 fixup
操作将保留原始消息并丢弃来自修复提交的消息。
关于git - Git/Git 扩展中的 "squash"和 "fixup"有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16758131/