tags:

views:

77

answers:

2

Between myself and another programmer who are working on the same project we consistently have a problem with git where we will commit a few changes to a specific file, push the changes up, and when the other pulls down the entire file is conflicted. It only happens with one file in our repository.

Also we noticed in github when you view that file it only shows the first two lines. However when you view it as raw it contains the entire file.

+2  A: 

Are you on Windows if so perhaps the file has Unix end of line markers which things like notepad see as one line.

On article is from Coding Horror

Mark
That could very well be it. We both normally work on OS X but my partner has a few times worked on it in Windows.
BenMills
A: 

Is it possible that file somehow has an embedded NUL character? By your description of the formatted file view on Github being truncated, it sounds like that might be possible. I'm not sure what the internal merge in Git does when it encounters a NUL character.

If you have hexdump on OS X that will help, otherwise try od with a suitable set of options.

Greg Hewgill
OS X also has xxd
William Pursell