问题
When I use git config --list
to check the value of core.autocrlf
in --system
, --global
, and --local
this is what I get:
$ git config --system --list | grep autocrlf
core.autocrlf=true
$ git config --global --list | grep autocrlf
core.autocrlf=true
$ git config --local --list | grep autocrlf
Which is fine.
But when I do it for everything (without the --system
, --global
, or --local
), I get something odd:
$ git config --list | grep autocrlf
core.autocrlf=false
core.autocrlf=true
core.autocrlf=true
Where does that first false
value come from, if it's not in my --system
, --global
, or --local
?
I am using the version of git that comes with SourceTree for Windows.
回答1:
As you found out the configuration can be found under 3 location on your machine.
Sourcetree also has its own git version which you can use. if you use it and not the system git you will have another .gitconfig file.
This is where your values are coming from.
In windows you will find inside:
C:\Program Files (x86)\Atlassian\SourceTree\SourceTree.exe.config
Its not the usual git config, its an XML file which sourceTree reads the values from.
For example here is an entry from this file:
<setting name="DiffWhiteSpaceIgnored" serializeAs="String">
<value>False</value>
</setting>
You can set it here:
来源:https://stackoverflow.com/questions/34136453/where-is-this-value-in-my-configuration-coming-from