Git Config core.autocrlf覆盖

时间:2016-09-28 20:07:59

标签: git

我正在尝试将autocrlf属性设置为false。出于某种原因,我目前有3个这样的条目,我假设其中一个覆盖了其他条目。 正在运行git config -l会返回一个包含3个autocrlf条目的列表,其中一个true,其中2个false enter image description here

运行git config --global -l会返回一个列表,其中autocrlf个条目设置为false enter image description here

运行git config --local-l会返回一个列表,其中autocrlf个条目设置为false enter image description here

运行git config --system -l会返回错误 enter image description here

某处有一个文件可能包含真实设置。我怎样才能找到这个文件?我得到的系统配置错误可能与它有关吗?

提前致谢。

2 个答案:

答案 0 :(得分:4)

使用git 2.8之后的版本,您只需使用:

git config --list --show-origin

您将看到哪个配置设置在哪里。

另请参阅“Where do the settings in my Git configuration come from?

第三个条目也可能存在于c:\ Users \ All Users \ git \ config中,但上述命令的输出应该可以消除猜测。

答案 1 :(得分:1)

原来Windows安装程序设置了有问题的属性。特别是这个页面: enter image description here

选择第一个选项时, c:\ ProgramData \ Git \ config 文件中的autoclrf设置为true。不知道如何使用控制台命令来改变它,比如git config - " which_one?" core.autocrlf false。作为解决方法,只需编辑文件。

相关问题