Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
871 views
in Technique[技术] by (71.8m points)

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

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

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

In 2.1 - Getting a Git repository, it says:

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

$ 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. ._.

Edit: Heres a screenshot, maybe it helps you:

._.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.eol settings per files is more precise than using a repo-wide global setting)

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, false or input are, as detailed here.


FernandoZ suggests in the comments:

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...