git init - 'core.autocrlf' 中的错误数字配置值 'auto'

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21328687/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 09:38:16  来源:igfitidea点击:

git init - bad numeric config value 'auto' for 'core.autocrlf' in

git

提问by Realit?tsverlust

Just started working with git 15 minutes ago and already trouble ... damn.

15 分钟前刚开始使用 git 并且已经麻烦了......该死。

Well, just as i wrote in the headline, im currently working with the git-scm book here: http://git-scm.com/book

好吧,正如我在标题中所写的那样,我目前正在使用 git-scm 书:http: //git-scm.com/book

In 2.1 - Getting a Git repository, it says:

在 2.1 - Getting a Git repository 中,它说:

If you're starting to track an existing project in Git, you need to go to the project's directory and type

如果您开始在 Git 中跟踪现有项目,则需要转到项目目录并键入

$ git init

Thats exactly what im doing, but somehow, i get this error message here:

这正是我在做什么,但不知何故,我在这里收到此错误消息:

fatal: bad numeric config value 'auto' for 'core.autocrlf' in C:\Program Files 
(x86)\Git(etc/gitconfig: invalid unit

I configured everything just as it says in the book ... im kinda helpless here, especially because i got absolutely no experience with git and google doesnt seem to be very helpful in that case. ._.

我按照书中所说的那样配置了所有内容……我在这里有点无助,尤其是因为我完全没有使用 git 的经验,而在这种情况下,google 似乎并没有多大帮助。._.

Edit: Heres a screenshot, maybe it helps you:

编辑:这是一个截图,也许对你有帮助:

._.

._.

回答by VonC

Try a

尝试一个

git config --system --unset core.autocrlf

I would then advise for a:

然后我会建议:

git config --global core.autocrlf false

(see "Why should I use core.autocrlf=true in Git?"; using core.eolsettingsper files is more precise than using a repo-wide global setting)

(请参阅“为什么我应该在 Git 中使用 core.autocrlf=true?”;使用每个文件的core.eol设置比使用存储库范围的全局设置更精确)

You could set it back in the system config if you want:

如果需要,您可以在系统配置中将其重新设置:

git config --system core.autocrlf false

But the main point is 'auto' isn't a valid value: true, falseor inputare, as detailed here.

但重点是 'auto' 不是一个有效值:truefalse或者input是,如详述here



FernandoZsuggests in the comments:

FernandoZ在评论中建议:

git config --global --replace-all core.autocrlf false