Binary files being corrupted by Auto CRLF


I use TeamCity 8.0.6 with my .net project.

Currently all my developers use Git for Windows and they use autocrlf option.

Therefore my teamcity VCS also uses the "Convert line-endings to CRLF" option.

The problem is, some PDF files are beign corrupted - which doesn't happen on local checkouts.

I've read jGit used by teamcity ignores configurations on the .gitattribute files.

What is JetBrains advice on this case?


Comment actions Permalink

Hi Rafael,

What type of checkout do you use: agent- or server-side? Convert line-endings to CRLF option works only for server-side checkout. In case of agent-side checkout native Git which respects core.autocrlf config parameter is used.

Comment actions Permalink

Hi Alina!

Thanks for the reply!

I have 7 agents in total, using client-side checkout would be a huge loss of performance - plus the fact that I use Checkout Rules - which I would have to stop using and that would be another performance problem.

Isn't there any other option?

UPDATE: Also, for server side using the "Convert line-endings to CRLF" is what is causing the issue, becaue it's messing with the "line-endings" on my PDF file - which it should not since it's a binary file.
Messing with the "line-endings" of the PDF is making it a invalid file. That is actually the bug I think to be a TeamCity bug.

Comment actions Permalink

Hi Rafael,

TeamCity indeed doesn't support .gitattributes. It uses an heuristics to detect binary files, but in your case they don't work. I've created an issue in the tracker, please watch it. The only workaround at the moment is to use an agent-side checkout. In recent TeamCity versions I think it should be faster than server-side checkout. Another workaround is to keep pdf files in a separate repository with 'Convert line-endings to CRLF' turned off.


Please sign in to leave a comment.