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?
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.
gitattributes not override core.
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.
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").
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With