git added by them renaming conflict - git recognises the same files in the renamed directory as new files

被刻印的时光 ゝ 提交于 2019-12-23 04:04:35

问题


I've renamed a directory and merged it into my main branch, when merging another branch, git recognises the same files in the renamed directory as new files.

I get the merge conflict 'added by them' for the same files in that directory when merging in another's branch:

added by them: theirDir/same_file_name.xxx

I've renamed the directory in their branch to match and continue to get the 'added by them' conflict.

When I try to checkout --ours I get

$ git checkout dir/same_file_name.xxx --ours

error: path 'dir/same_file_name.xxx' does not have our version

At this point deleting this file actually, deletes the file after the merge completes.

How can I resolve this conflict?

--- m ----\ ------------  m1 --------------- mx ------- *!*
     \     \            /   \                /         /  
      \     dir-rename-/     file_revisions-/         /
       \                                             /
        f2 ---------- file added by them conflict --/

Multiple file revisions from multiple branches have occurred before the merge conflict.


回答1:


Instead of using msysgit 1.9.5, try the latest Git for Windows:

Since Git 2.18, git status does a better job detecting renamed (of files and folders)



来源:https://stackoverflow.com/questions/41811411/git-added-by-them-renaming-conflict-git-recognises-the-same-files-in-the-renam

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