这个值在我的配置中来自哪里? [英] Where is this value in my configuration coming from?

查看:132
本文介绍了这个值在我的配置中来自哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用 git config --list 检查<$ c $中的 core.autocrlf 的值时c> - system , - global - local 这就是我得到:

  $ git config --system --list | grep autocrlf 
core.autocrlf = true
$ git config --global --list | grep autocrlf
core.autocrlf = true
$ git config --local --list | grep autocrlf

这就好。

但是当我这样做的时候(没有 - system - global - local ),我得到一些奇怪的东西:

  $ git config --list | grep autocrlf 
core.autocrlf = false
core.autocrlf = true
core.autocrlf = true

第一个 false 值来自哪里,如果它不在我的 - system , - 全球 - 本地



我使用SourceTree for Windows附带的git版本。

解决方案

当您发现可以找到配置在你机器的3个位置。



Sourcetree也有它自己的git版本,你可以使用它。
如果你使用它,而不是系统git,你将拥有另一个.gitconfig文件。



这是你的值来自哪里。



在windows中您可以找到以下内容:

  C:\程序文件(x86) \Atlassian\SourceTree\SourceTree.exe.config 

它不是通常的git config,它的sourceTree从中读取值的XML文件。



例如,以下是此文件中的一个条目:

 < setting name =DiffWhiteSpaceIgnoredserializeAs =String> 
<值> False< /值>
< / setting>

你可以在这里设置:


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.

解决方案

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:

这篇关于这个值在我的配置中来自哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆