Trying to configure global user name and email but keep getting the same error message:
What am I missing?
I'm on a Macbook Air (Mojave) using Terminal.
Check the contents of the file:
cat ~/.gitconfig
The format should look something like:
[user]
name = Firstname Lastname
email = name@example.com
[core]
etc....
As @Jobin Kuruvilla [Adaptavist] suggested, it might be malformed and need manual updating.
There were some lines that I had to delete in the gitconfig file (i.e. two empty, two with an outdated username and email).
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is possible that the existing git config was tampered with. Check this answer:
https://stackoverflow.com/questions/45174228/git-error-key-does-not-contain-a-section
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For me the similar problem had the next reason:
Right after installing git, I made a mistake in one of the initial commands I tried to run:
$ git config --global "my name" /* incorrect command */
I just forgot to give one of parameter, so even the .gitconfig file at my home directory wasn't created. The following command produced no output:
$ git config --list
Just to highlight: this was an error in my first configuration command since installing the program.
The problem was solved by correct command:
$ git config --global user.name "my name"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
[user] + [core]
# inner local project
$ vim .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[user]
name = xgqfrms
email = xgqfrms@ufo.com
$ cat .git/config
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
$ vim ~/.gitconfig # email = xgqfrms@ufo.com # name = xgqfrms [user] email = xxx@xxx.com name = xgqfrms $ cat ~/.gitconfig
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.