在两个分支中未修改的文件中合并冲突 [英] Merge conflict in a file that wasn't modified in either branch

查看:141
本文介绍了在两个分支中未修改的文件中合并冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试对master上的分支featureX重新设置基准时,我在一个文件(我们称其为moduleA/foo)中遇到了冲突,该文件在masterfeatureX中均未修改,因为它们之间存在差异!我使用以下日志命令进行了检查:

When I try to rebase branch featureX on master, I get a conflict in a file (let's call it moduleA/foo) that was not modified in either master or featureX since they diverged! I checked that with the following log command:

git log master...featureX -- moduleA/foo

,结果为空(由于分支不同,两个分支上的任何提交都没有接触到文件).

and the result was empty (no commit on either branch touched the file since the branches diverged).

这怎么可能?为了避免这种误导性的冲突,我该怎么办?

How is this at all possible and what can I do to avoid such misleading conflicts?

推荐答案

正如@Xlee所说,rebase可能会导致更改提交的哈希并弄乱历史记录.

As @Xlee said, rebase can result on changing the hash of the commit and messing up with history.

还有其他一些可能性,例如:
-featureX已被强制按下
-有人创建了一个提交,该提交更改了moduleA/foo文件并在master
上将其还原 -您的GIT充满乐趣,喜欢取笑您. 您的选择

There are some other possibilities such as :
- featureX have been force pushed
- Someone created a commit which changes the moduleA/foo file and reverted it on master
- you GIT is playfull and likes to tease you. Your choice

这篇关于在两个分支中未修改的文件中合并冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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