Reputation: 35
I want to configure Git, but I deleted my configuration file before (a big mistake). It shows me
No such file or directory
when I put in ~/.gitconfig
:
$ git config global user.name "a"
error: key does not contain a section: global
$ ~/.gitconfig
-bash:/.gitconfig: No such file or directory
Upvotes: 2
Views: 1875
Reputation: 136880
Add dashes to global
:
git config --global user.name "a"
Without the dashes global
is getting interpreted as a section, but that's not valid. You want the --global
flag.
The file doesn't need to exist before you run this command. Git will create it if it's not there.
Upvotes: 1