Why is Git reporting autocrlf as true?

183 views Asked by At

I'm on Windows and autocrlf has never been an issue. I have always had it set to false in a system-wide config and never changed it to true. However, in one of my repos, the git config core.autocrlf started reporting "true".

This is my system-wide config (C:\Program Files (x86)\Git\etc\config):

[core]
    ...
    autocrlf = false

There is then no mention of autocrlf in both my global config (C:\Users\Borek\.gitconfig) and myproject\.git\config. Still, when I run

git config core.autocrlf

it prints out true. What could it be?

1

There are 1 answers

3
Tarrenam On BEST ANSWER

Git probably isn't using the file in Program Files. There should be a .gitconfig file wherever git considers its home directory to be. You can find out where that is in Git Bash with

echo ~

In my case, although I have git installed to the same place as you, running the above prints /z, which is a network drive. My global .gitconfig is at /z/.gitconfig - you should have an equivalent file. Have a look in there, and see what core.autocrlf is set to.