Merge conflict in a file that wasn't modified in either branch

↘锁芯ラ 提交于 2019-12-10 16:35:47

问题


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?


回答1:


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

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



来源:https://stackoverflow.com/questions/41064345/merge-conflict-in-a-file-that-wasnt-modified-in-either-branch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!