我使用Git Extensions已经有一段时间了(太棒了!)但我还没有找到一个简单的答案来回答以下问题:
有时,在输入提交消息时,会出现打字错误。我的朋友向我展示了如何通过以下方式修复它(在Git扩展中):
右键单击commit > Advanced > Fixup commit

然后我只需勾选“修改”框并重写我的消息,瞧!我的提交消息是固定的。
然而,另一个选项"Squash commit"...我一直想知道它是做什么的?!
我的问题是:
谁能简单地给我解释一下Squash commit和Fixup commit在Git/ Extentions中的确切区别是什么?他们看起来有点...和我“相似”:


发布于 2013-05-26 19:11:08
我不知道Git扩展具体用它做了什么,但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).压缩和修复的不同之处在于,在rebase期间,squash操作将提示您合并原始和压缩提交的消息,而fixup操作将保留原始消息并丢弃修复提交的消息。
发布于 2014-07-11 22:20:20
简单地说,当对一系列commit进行重构时,每个commit标记为一个squash,这样您就有机会将其消息用作pick或reword commit消息的一部分。
当您使用fixup时,来自该提交的消息将被丢弃。
发布于 2019-12-30 04:55:22
如果问题是git中的squash和fixup在执行git rebase --interactive时有什么不同,那么答案是提交消息。
s, squash <commit>=使用提交,但合并到以前的提交中
f, fixup <commit> = like“”,放弃此提交的日志消息
例如:
pick 22a4667 father commit message
squash 46d7c0d child commit message # case 1
# fixup 46d7c0d child commit message # case 2在情况1中,重新建立基础后的提交消息将是:
father commit message
child commit message而案例2中的提交消息是:
father commit message
# no sub messageshttps://stackoverflow.com/questions/16758131
复制相似问题