Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Definitive recommendation for git autocrlf settings

I use Windows, Mac OS X and linux on a daily basis. I use git in all these environments, pulling from repos that are used by folks with different choices for line endings.

Are there definitive recommendation for setting core.autocrlf in my situation?

like image 797
rbellamy Avatar asked Jan 06 '10 22:01

rbellamy


People also ask

What is git config core Autocrlf?

The git config core. autocrlf command is used to change how Git handles line endings. It takes a single argument. On macOS, you simply pass input to the configuration. For example: $ git config --global core.autocrlf input # Configure Git to ensure line endings in files you checkout are correct for macOS.

Does Gitattributes override Autocrlf?

gitattributes not override core.

What is Autocrlf true?

autocrlf . This is a similar approach to the attributes mechanism: the idea is that a Windows user will set a Git configuration option core. autocrlf=true and their line endings will be converted to Unix style line endings when they add files to the repository.


1 Answers

I would recommend, as I did in this SO question, to set it to false.

If you can avoid modifying any eol (with your editor), then it would be best to push back your work with those eol unchanged (i.e. "as you found them").

like image 192
VonC Avatar answered Sep 30 '22 12:09

VonC