"git init" failed, what's wrong?

hugemeow picture hugemeow · Sep 6, 2012 · Viewed 13.6k times · Source

This issue is not same as "Bad git config file .git/config", since it failed when using git init.

It seems there is nothing wrong with /home/mirror/.gitconfig:

[mirror@home php]$ git init
error: Malformed value for push.default: simple
error: Must be one of nothing, matching, tracking or current.
fatal: bad config file line 8 in /home/mirror/.gitconfig

This is the content of ~/.gitignore:

cat ~/.gitconfig
[alias]
        lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
[user]
        email = [email protected]
        name = xxxxx
[push]
        default = simple

Answer

Kim E picture Kim E · Sep 6, 2012

Simple was added in git v1.7.11. If your git version is older, this option doesn't exist. Simply remove it from your conf and you'll be able to init repos.

See Documentation