I'm in the process of merging two git branches that are fairly diverged. After the automatic merge is complete, I ended up having multiple files having two versions:
file.cc~HEAD
file.cc~branchA
While the original file.cc
was gone.
Since both files are identical, I'm slightly puzzled. Why does it happen? Which kind of conflict does it represent?
As you mention that you are trying to merge two git branches that are fairly diverged. So in this situation, automatic merge fail.
Ideally, this situation occurs when your local file let say
file.cc
and file in the other branch in which you are merging are fairly diverged or lack any common ancestor so they cannot be merged. And then, we must keep both files in the working directory but as a conflict. Sofile.cc~HEAD
andfile.cc~branchA
files created and original filefile.cc
deleted.For more information on
git merge
read this article.