Why should I use core.autocrlf in Git
Posted
by Rich
on Stack Overflow
See other posts from Stack Overflow
or by Rich
Published on 2010-05-13T08:50:11Z
Indexed on
2010/05/13
8:54 UTC
Read the original article
Hit count: 239
I have a Git repository that is accessed from both Windows and OS X, and that I know already contains some files with CRLF line-endings. As far as I can tell, there are two ways to deal with this:
Set
core.autocrlf
tofalse
everywhere,Follow the instructions here (echoed on GitHub's help pages) to convert the repository to contain only LF line-endings, and thereafter set
core.autocrlf
totrue
on Windows andinput
on OS X. The problem with doing this is that if I have any binary files in the repository that: a). are not correctly marked as binary in gitattributes, and b). happen to contain both CRLFs and LFs, they will be corrupted. It is possible my repository contains such files.
So why shouldn't I just turn off Git's line-ending conversion? There are a lot of vague warnings on the web about having core.autocrlf
switched off causing problems, but very few specific ones; the only that I've found so far are that kdiff3 cannot handle CRLF endings (not a problem for me), and that some text editors have line-ending issues (also not a problem for me).
The repository is internal to my company, and so I don't need to worry about sharing it with people with different autocrlf settings or line-ending requirements.
Are there any other problems with just leaving line-endings as-is that I am unaware of?
© Stack Overflow or respective owner