Merge conflict error, when there was no change in mentioned file
I have a site local repo and a remote repo.
Local repo contains the 1-2 month old content of remote repo.
I try to pull the whole content into local repo.
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.
I checked process_email.php using P4Merge, but shows no conflict, furthermore there were no changes at all, no difference.
$ git status On branch master nothing to commit, working directory clean on both repos.
Also I tried
$ git pull -X theirs origin/master master
But still get the same error.
I want to merge the remote origin repo with my local repo.
I want to overwite local repo with remote origin repo content as the remote repo is newer, contains the latest code.
More than 2000 files are conflicting, while I checked the conflict and they have the same content. I would not want to do manual conflict handling.
autocrlf = False
in the .gitconfig.
Why do I get conflict error for files, which have exactly the same content?
2 Solutions collect form web for “Merge conflict error, when there was no change in mentioned file”
Finally solved the problem, based on solution used in following thread:
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 was executed successfully, no conflicts anymore.
I could now overwrite the old_content directory, if I want, then commit.
The messages says you have a
add/add conflict, meaning that the file was added both in your branch and in the one you’re merging. This limits Git’s ability to merge because there’s no common ancestor (i.e. you’ll get conflicts for every part of the file different on both sides). Open the file in your text editor and see if you have conflict markers and resolve them.
git status will give you more information about what’s goin on.
Once you’re satisfied with the content of the file, run
git add on it and