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
The git init command creates a new Git repository. It can be used to convert an existing, unversioned project to a Git repository or initialize a new, empty repository. Most other Git commands are not available outside of an initialized repository, so this is usually the first command you'll run in a new project.
Once you have initialized the repository, create a remote repository somewhere like GitHub.com. Then, add the remote URL to your local git repository with git remote add origin <URL> .
To do so, you need to navigate to the correct folder and then run the command git init , which will create a new empty Git repository or reinitialize an existing one.
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
This problem keeps coming up now that git 1.8 is out. Luckily the message from git is now very helpful:
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
For example, emacs interface to git (vc) does not understand the argument 'simple', so you are better off using the argument 'matching' for the time being.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With