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

4.7k views Asked by At

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.

2

There are 2 answers

0
MrTux On BEST ANSWER

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

0
Borek Bernard On

Aha, .gitattributes also influences this, and there is such file in the wp-cli repository.