git - merge 冲突错误,当提到的文件没有变化时

标签 git git-merge

我有一个站点本地存储库和一个远程存储库。 本地仓库包含远程仓库 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/

相关文章:

java - GitHub 在不同的分支上工作,但在同一个类上。我们如何 merge 这个?

git - 使用什么 SCM 来跟踪应用程序和系统配置文件?

Git merge/cherry-pick 避免暂存

Git - 在 github 上使用端口 9418 进行远程操作

git - 回滚到 Mercurial 中的旧版本(如 git reset)

git - 将git merge驱动程序添加到存储库?

git - Git merge 编译后的文件有问题吗?

git - merge 具有相似分支签名的分支

git - 当指定 --no-color 时,不要使用 git log --pretty 对引用进行着色

git - merge 没有 parent 的提交