Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

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:

._.

like image 250
Realitätsverlust Avatar asked Jan 24 '14 09:01

Realitätsverlust


2 Answers

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
like image 52
VonC Avatar answered Sep 20 '22 06:09

VonC


  1. go to repo folder
  2. open the .git folder
  3. open the file config
  4. remove duplicate entries
like image 44
stifler97 Avatar answered Sep 21 '22 06:09

stifler97