0

If I merge to branches with git merge branchname I get a merge conflict, as the new files adds carriage returns (^M) after every line.
I use vim to resolve the conflicts and found out that the fileformat of LOCAL, BASE and REMOTE file is dos whereas the new file is unix.

How do I (permanently) fix such problems? I could remove all the carriage returns by hand, but I don't think this is the right way. I also tried changing the fileformat with set ff but it didn't change anything.


Edit: is it possible for git merge to ignore line ending differences doesn't really help here. The branches I am merging use the same line ending. Only the merge introduces a new line ending. The proposed solutions don't affect my problem, I have tried them before.

Community
  • 1
  • 1
DerWeh
  • 1,721
  • 1
  • 15
  • 26
  • open with a editor that respects the file type and different enter characters – lordkain Dec 01 '16 at 08:39
  • possible answers here: http://stackoverflow.com/questions/17579553/windows-command-to-convert-unix-line-endings but permanently use editors that do not change line endings and choose a standard (e.g always use unix line endings or always use dos line endings) – namingFailed Dec 01 '16 at 09:29
  • The answer gives a workaround, temporarily I fix the problem by substituting the line ending anyway. I am using `Vim` as text editor, I thought it already respects line endings, I think there is nothing to do concerning this point. – DerWeh Dec 02 '16 at 11:34

0 Answers0