git: trying to merge branches, but there are TONS of conflicts, and most of them /shouldn't/ be conflicts

こ雲淡風輕ζ 提交于 2019-12-23 02:04:55

问题


Here is a lot of what I'm getting:

<<<<<<< HEAD
code
=======
>>>>>>> Merge branch 'master' of code_url into not_master

and there are tons of those occurring multiple times in 40+ files. Is there a different way to merge such that it correctly resolves conflicts on its own? I feel like whenever it encounters any simultaneous difference in a location a file, git decides to flip ALL THE TABLES.

(╯°□°)╯︵ buıbɹǝɯ ʇıb

I looked at rebase, and it MAY have been what I have needed when I started the branch. To start rebasing - I still need to deal with all these conflicts.


回答1:


I've often seen this when git has record of lines being deleted. It doesn't seem to want to auto-merge if a line has been edited in one branch but deleted in another.




回答2:


Have you checked whether there are line ending differences? The above may stem from a line ending of \r in the repo and and \n in the working directory.



来源:https://stackoverflow.com/questions/9710366/git-trying-to-merge-branches-but-there-are-tons-of-conflicts-and-most-of-them

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