The best explanation of how core.autocrlf works is found on the gitattributes man page, in the text attribute section.
This is how core.autocrlf appears to work currently (or at least since v1.7.2 from what I am aware):
core.autocrlf = true
- Text files checked-out from the repository that have only
LFcharacters are normalized toCRLFin your working tree; files that containCRLFin the repository will not be touched - Text files that have only
LFcharacters in the repository, are normalized fromCRLFtoLFwhen committed back to the repository. Files that containCRLFin the repository will be committed untouched.
core.autocrlf = input
- Text files checked-out from the repository will keep original EOL characters in your working tree.
- Text files in your working tree with
CRLFcharacters are normalized toLFwhen committed back to the repository.
core.autocrlf = false
core.eoldictates EOL characters in the text files of your working tree.core.eol = nativeby default, which means working tree EOLs will depend on where git is running:CRLFon a Windows machine, orLFin *nix.- Repository
gitattributessettings determines EOL character normalization for commits to the repository (default is normalization toLFcharacters).
I’ve only just recently researched this issue and I also find the situation to be very convoluted. The core.eol setting definitely helped clarify how EOL characters are handled by git.