Why does 'git merge' add files ending with tilde?

僤鯓⒐⒋嵵緔 提交于 2019-12-06 21:10:49

问题


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?


回答1:


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. So file.cc~HEAD and file.cc~branchA files created and original file file.cc deleted.

For more information on git merge read this article.



来源:https://stackoverflow.com/questions/30863064/why-does-git-merge-add-files-ending-with-tilde

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!