本文介绍了“squash”与“squash”之间的区别是什么?和“修复”在Git / Git Extension中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用 Git Extensions 一段时间(这太棒了!),但我还没有找到一个简单的答案:



有时候,输入提交信息时,会出现拼写错误。我的朋友向我展示了如何通过以下方式修复它(在Git Extentions中):



然后,我只需选中修改框并重写我的信息,然后瞧!我的提交消息是固定的。



然而,这个其他选项壁球提交...我一直想知道它做了什么?!

我的问题是:

有人会简单地解释一下壁球提交 Git / Git Extentions 中的strong>和 Fixup commit ?他们看起来很像... 相似给我:

解决方案

我不知道Git Extensions具体做什么,但是git rebase有一个选项可以自动挤压或修正提交的壁球!或修复!前缀分别为:

  --autosquash,--no-autosquash 
当提交日志消息以squash !(或fixup!
...),并且有一个标题以相同...开头的提交,
会自动修改rebase -i的todo列表,以便在被修改的提交之后,提交
被标记为压扁,
并将提交的提交的操作从提取变为压扁(或
修正)。

压扁和修正的区别在于,在压缩过程中,压扁操作会提示您合并原始消息和壁球提交,而修复操作将保留原始消息并放弃修复提交中的消息。


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 commit message, a make a typo. My friend showed me how to fix it the following way (in Git Extentions):

Then I simply check the box "Amend" and rewrite my message and voila! My commit message is fixed.

However this other option "Squash commit"... I have always wondered what it does?!

My question is:

Would someone simply explain me what is the exact difference between Squash commit and Fixup commit in Git/Git Extentions? They look kind of... "similar" to me:

解决方案

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.

这篇关于“squash”与“squash”之间的区别是什么?和“修复”在Git / Git Extension中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 19:51