Git More than one value for the key user.name/email
Problem 1. when I run the command
$ git config --global user.name # or $ git config --global user.email
I get the following error message:
error: More than one value for the key user.name/email
So it seems like I have multiple values stored against both my user name and email. I want to have one value stored in each.
Problem 2. The name shown against my commits on github is not linked to my account. means not hyper linked its blocked.
I searched a lot but got no satisfactory result to my problems. anyone can please help.
Are you using Windows or a Unix based system? If you are on a Unix based system you can check the config inside the config file. Go to your home folder and in there, there should be a hidden file called .gitconfig open it and see what info you have there. Maybe there is an error on the file.
Have a look in ~/.gitconfig
I'm guessing yours should look something like this:
... [user] name = Sami email = firstname.lastname@example.org name = Sami email = email@example.com ....
Just remove the dupliucate entries to get rid of the message.
In terms of linking to github, check out this answer
git config -l #shows you what name, email and other stuff is saved cat ~/.gitconfig #shows you samething(what's saved in your /home/username/.gitconfig)To change stuff on existing commits in your machine you can try this on the commandline:
$ git config user.name "Your Name" $ git config user.email "firstname.lastname@example.org" $ git submodule foreach --recursive 'git config user.name "Your Name" && git config user.email "email@example.com"'
.... see rest here : https://gist.github.com/carlosmcevilly/2221249ps:if you have already commited stuff and want snyc with github, then ask another question(that is separate issue)
Solution to Problem 1: First look to see what is listed in the config:
git config --list
enter code here firstname.lastname@example.org user.name=fiveisgreen user.github=fiveisgreen user.name=Anthony
In this example, user.name is listed twice. To remove the duplicate do:
git config --global --unset user.name Anthony