Search code examples
gitcore.autocrlf

Git clones repository with CRLF even though I have core.autocrlf=false


When I clone a repository that uses LF line endings using msysgit on Windows, the checked out files have somehow the CRLF line endings even though my core.autocrlf is set to false. Why is that?

Example:

> git config core.autocrlf
false

> git clone https://github.com/wp-cli/wp-cli.git wp-cli

The checked out files have CRLF line endings even though they have LF in the repository itself.


Solution

  • There is a .gitattributes file in the project

    # Auto detect text files and perform EOL normalization
    * text=auto
    

    This has higher priority than core.autocrlf.

    See http://git-scm.com/docs/gitattributes