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.