合并冲突错误,当提到的文件没有变化时

klo*_*lor 9 git git-merge

我有一个站点本地仓库和一个远程仓库.本地仓库包含1-2个月的远程仓库内容.

我尝试将整个内容整合到本地回购中.

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.
Run Code Online (Sandbox Code Playgroud)

我使用P4Merge检查了process_email.php,但没有显示冲突,而且根本没有任何变化,没有区别.

更新:

我明白了

$ git status
On branch master
nothing to commit, working directory clean on both repos. 
Run Code Online (Sandbox Code Playgroud)

我也试过了

$ git pull -X theirs origin/master master
Run Code Online (Sandbox Code Playgroud)

但仍然得到同样的错误.

我想将远程原始仓库与我的本地仓库合并.我想用远程源repo内容覆盖本地repo,因为远程repo更新,包含最新代码.

超过2000个文件存在冲突,而我检查了冲突并且它们具有相同的内容.我不想做手动冲突处理.

我在.gitconfig中有autocrlf = False.

为什么我的内容完全相同的文件会出现冲突错误?

klo*_*lor 5

最终根据以下线程中使用的解决方案解决了问题:

如何处理/修复 git add/add 冲突?

# 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
Run Code Online (Sandbox Code Playgroud)

Pull 执行成功,不再有冲突。

如果我愿意,我现在可以覆盖 old_content 目录,然后提交。

最好的问候,康拉德