在两个分支中未修改的文件中合并冲突 [英] Merge conflict in a file that wasn't modified in either branch
问题描述
当我尝试对master
上的分支featureX
重新设置基准时,我在一个文件(我们称其为moduleA/foo
)中遇到了冲突,该文件在master
或featureX
中均未修改,因为它们之间存在差异!我使用以下日志命令进行了检查:
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屋!