在任何一种情况下,任何"prepare"或"fix"提交,以及任何不能自行工作的提交,都应该有一个解释性的日志消息 . 如果's the merge itself that doesn'工作,请注意在合并提交的日志消息中:用以下内容替换相当无意义的 merge branch <name> 消息:
automatic but broken merge of branch <name>
This merge has the contents that Git produces on its own,
and exists so that someone who is repeating the work in the
future can do it automatically as well, and compare. The
*next* commit contains the manual change that makes the
merge functional, so when bisecting, use the *next* commit,
not this one.
当然,如果您更喜欢说"don't make broken commits on purpose"的思想流派,那么您只需合并并修复(使用 --no-commit 或 --amend ,无论您喜欢哪种方式) .
3 回答
是为了这个目的(见doc) .
(之后您不需要执行
git merge --continue
,只需在当前状态满足您的需求时提交您的工作 . 不要忘记add
您在非提交合并后可能已经引入的任何修改)(这应该是一个注释,但它有点长,需要一些格式化 . )
我写这篇文章的时候有两个答案:
git merge --no-commit
,根据需要调整结果(和git add
),并使用git commit
或git merge --continue
进行提交;要么git merge
,测试并修复(并根据需要使用git add
),并使用git commit --amend
将旧的合并提交移开,将其替换为新的改进提交 .两者都有效 . 但请注意,有一种思想流派认为你不应该做其中任何一种,因为将来不可能使用自动化系统来重复合并 . 我不清楚订阅这条规则的人选择哪个选项,因为有两个选项:
在合并之前,进行一次提交(或多次提交)以准备所有内容,以便自动合并成功并生成有效结果 .
或者,在成功但产生无效结果的自动合并之后,进行后续提交以修复它 .
在任何一种情况下,任何"prepare"或"fix"提交,以及任何不能自行工作的提交,都应该有一个解释性的日志消息 . 如果's the merge itself that doesn'工作,请注意在合并提交的日志消息中:用以下内容替换相当无意义的
merge branch <name>
消息:当然,如果您更喜欢说"don't make broken commits on purpose"的思想流派,那么您只需合并并修复(使用
--no-commit
或--amend
,无论您喜欢哪种方式) .您也可以先进行合并,然后测试它,修复问题,最后在推送之前修复合并提交.9129_ .