简体   繁体   English

我的配置中的这个值从哪里来?

[英]Where is this value in my configuration coming from?

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 --list检查--system ,-- --global--localcore.autocrlf的值时,这是我得到的:

$ 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: 但是,当我对所有内容(没有--system ,-- --global--local )执行此操作时,我会感到奇怪:

$ 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 ? 如果第一个false值不在我的--system ,-- --global--local--global --local

I am using the version of git that comes with SourceTree for Windows. 我正在使用Windows的SourceTree随附的git版本。

As you found out the configuration can be found under 3 location on your machine. 如您所知,配置可以在计算机上的3个位置下找到。

Sourcetree also has its own git version which you can use. Sourcetree也有自己的git版本,可以使用。 if you use it and not the system git you will have another .gitconfig file. 如果使用它而不是系统git,则会有另一个.gitconfig文件。

This is where your values are coming from. 这就是您的价值观的来源。

In windows you will find inside: 在Windows中,您可以找到以下内容:

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. 它不是通常的git config,而是一个XML文件,sourceTree从中读取值。

For example here is an entry from this file: 例如,这是此文件中的一项:

<setting name="DiffWhiteSpaceIgnored" serializeAs="String">
    <value>False</value>
</setting>

You can set it here: 您可以在这里设置:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM