邪恶融合在git中 - 它们从哪里来? [英] Evil merges in git - where do they come from?

查看:141
本文介绍了邪恶融合在git中 - 它们从哪里来?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读这个问题和答案,但什么不清楚我是世界卫生组织创造了没有出现在任何父母身上的变化。

是git合并算法搞砸了吗?

或者是因为用户必须手动调整冲突得到的东西建立,引入新的代码,这是不是在任何父母?

解决方案

它在第一正确的回答的评论。你可以在不做提交的情况下进行合并(无论是通过冲突还是--no-commit),然后在提交之前向合并添加其他更改。



注意,解决合并冲突是不是邪恶的,你只需挑选存在于冲突一方或双方的代码。如果你添加了一些不存在于任何一方的代码,你现在已经变成了合并恶魔。


I've read this question and the answers, but what isn't clear to me is WHO creates the "changes that do not appear in any parent".

Is it the git merge algorithm screwing up?

Or is it because the user has to manually adjust the conflicts to get the thing to build, introducing new code which wasn't in either parent?

解决方案

It is explained in the first comment of the correct answer. You merge without doing a commit (either through conflict or --no-commit) and then add additional changes to the merge before committing.

Note, resolving a merge conflict is not evil, you simply pick code which exists in one or both sides of the conflict. If you add some code which does not exist in either side, you have now turned the merge evil.

这篇关于邪恶融合在git中 - 它们从哪里来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆