Afternoon Paul,

On 18/10/17 14:08, Paul Vinkenoog wrote:

A number of source files in my (Windows) CVS working dir have Unix line endings 
though, whereas their Git counterparts have DOS endings.

That's no problem, as long as it doesn't lead to a huge number of 'changes' and 
log messages when such a file is committed, cluttering the history and drowning 
the real changes.

This is a documented feature of Git.

Github has a document about how you can set up your git client to cope with this. The URL is

From the online "Pro Git" book, we have this from (scroll down!):


If you’re programming on Windows and working with people who are not (or vice-versa), you’ll probably run into line-ending issues at some point. This is because Windows uses both a carriage-return character and a linefeed character for newlines in its files, whereas Mac and Linux systems use only the linefeed character. This is a subtle but incredibly annoying fact of cross-platform work; many editors on Windows silently replace existing LF-style line endings with CRLF, or insert both line-ending characters when the user hits the enter key.

Git can handle this by auto-converting CRLF line endings into LF when you add a file to the index, and vice versa when it checks out code onto your filesystem. You can turn on this functionality with the core.autocrlf setting. If you’re on a Windows machine, set it to true – this converts LF endings into CRLF when you check out code:

$ git config --global core.autocrlf true

If you’re on a Linux or Mac system that uses LF line endings, then you don’t want Git to automatically convert them when you check out files; however, if a file with CRLF endings accidentally gets introduced, then you may want Git to fix it. You can tell Git to convert CRLF to LF on commit but not the other way around by setting core.autocrlf to input:

$ git config --global core.autocrlf input

This setup should leave you with CRLF endings in Windows checkouts, but LF endings on Mac and Linux systems and in the repository.

If you’re a Windows programmer doing a Windows-only project, then you can turn off this functionality, recording the carriage returns in the repository by setting the config value to false:

$ git config --global core.autocrlf false

So, windows users need:

$ git config --global core.autocrlf true

and Linux and Mac users need:

$ git config --global core.autocrlf input

Anyway, I guess that won't occur if we commit all our work to CVS before the 
conversion/transition, get a fresh git clone afterwards and work only from 
that. Am I right?

In a word, yes. Provided that you configure the Git client before checking out and definitely before checking in.


Norman Dunbar
Dunbar IT Consultants Ltd

Registered address:
27a Lidget Hill
West Yorkshire
United Kingdom
LS28 7LG

Company Number: 05132767

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
Firebird-docs mailing list

Reply via email to