问题
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