Intermittently adding UNIX line ending

Sep 17, 2012 at 9:31 PM

Occasionally we are finding files with a single unix line ending at the end of .cs files.

I can't reproduce at the moment, just wanted to mention in case others are seeing this too.

What I know:

- seems to occur on files without a trailing line ending

- the last time it happened I think it occurred during the tf pull --rebase

- core.autocrlf = false (this is set on system, global and global when run as administrator)



Sep 17, 2012 at 11:23 PM

My best guess is git tf pull --rebase adds a trailing unix line ending when the file does not have a trailing end-of-line and another user had modified the file causing a merge.


This problem occured again, this time on a .csproj file:

1. changed .csproj file

2. git add -A, git commit

3. no unix line endings in my working folder

4. git tf pull --rebase

5. since my last pull another user modified the same .csproj file, git merged the changes automatically (did not need to use git mergetool)

6. after this command completed, I found a unit line ending

Sep 18, 2012 at 1:49 PM

Hello Brain,

Since you have "- core.autocrlf = false" set on your environment, I am wondering if the other user also have this set, what I am suspecting is happening is that the other user does not have this set and when he modified the file he had the UNIX line ending inserted. When you pulled his change, the UNIX line ending was merged into your repo.

Is it easy to verify that option on the other user machine ?




Sep 19, 2012 at 8:16 PM

Hi Youhana,

In this case the other user was using TFS without git. I think I can reproduce the problem:

1. Another user changes a file without a trailing newline and checks into TFS using VisualStudio

2. I make a change to the same file and commit locally

3. At this point the file does not a trailing line ending in git or TFS

3. I run get tf pull --rebase

4. git merges the file automatically with no conflicts but adds a UNIX line ending to the file locally

5. git status shows no staged/unstaged changes




Sep 19, 2012 at 8:25 PM


thanks for the detailed repro. I will try to repro this one here and let you know what I find.



Oct 4, 2012 at 8:42 PM

Hello Brian,

Thanks for reporting this issue.

I tracked this issue down. It is an issue with JGIT merge / rebase code.

Please let us know if you hit any other issues or have any feedback regarding git-tf.



Oct 4, 2012 at 8:44 PM

As a workaround you could execute git tf fetch then git rebase fetch_head instead of git tf pull --rebase. the native git rebase does not produce the problem. That said I will file a bug and work to get it fixed.



Oct 10, 2012 at 11:14 PM