Erel Segal-Halevi Erel Segal-Halevi - 3 months ago 19
Git Question

Merge files with different end-of-line character

I work with GIT on Linux, and my colleague works with GIT on Windows.

I commited some changes to a file, and my colleague commited some other changes to that file.

My colleague pushed, and I pulled.

Now, my entire file is a one big conflict:

<<<<<<< HEAD
...
[my version]
....
=======
...
[colleague's version]
...
>>>>>>> branch 'master' of https://github.com/rothariel/aimnegochat.git


What can I do? How can I merge the changes?

Answer

From this article in github you can overcome such problem

the suggested eol is \n, you can use this to autoconvert

git config --global core.autocrlf input
# Set this setting on OSX or Linux

git config --global core.autocrlf true
# Set this setting on Windows

Have a look at the example what to do next.

https://help.github.com/articles/dealing-with-line-endings