我有一个站点本地存储库和一个远程存储库。 本地仓库包含远程仓库 1-2 个月前的内容。
我尝试将全部内容 pull 入本地存储库。
git pull origin master
From ssh://.../site.git
* branch master -> FETCH_HEAD
...
CONFLICT (add/add): Merge conflict in admin/process_email.php
Automatic merge failed; fix conflicts and then commit the result.
我用 P4Merge 检查了 process_email.php,但没有显示冲突,而且根本没有变化,没有区别。
更新:
我明白了
$ git status
On branch master
nothing to commit, working directory clean on both repos.
我也试过了
$ git pull -X theirs origin/master master
但还是报同样的错误。
我想将远程原始仓库与我的本地仓库 merge 。 我想用远程源 repo 内容覆盖本地 repo ,因为远程 repo 较新,包含最新代码。
2000多个文件冲突,我检查冲突,内容相同。我不想进行手动冲突处理。
我有 autocrlf = 假 在 .gitconfig 中。
为什么内容完全相同的文件会出现冲突错误?
最佳答案
基于以下线程中使用的解决方案,最终解决了问题:
How to handle/fix git add/add conflicts?
# moved all files from the local workdir to another directory.
mv /workdir/* /old_content
# commit this change
git commit -m 'Resolve git Add/Add branch merge conflict by deleting conflicted folder and files in myconflictedfolder'
# do merge from remote
git pull origin master
pull 成功,不再有冲突。
我现在可以覆盖 old_content 目录,如果我愿意,然后提交。
最好的问候, 康 pull 德
关于git - merge 冲突错误,当提到的文件没有变化时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30260996/