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.

Answers


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 = xxx@xx.com
  name = Sami
  email = xxx@xxx.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 "your@address.com"
$ git submodule foreach --recursive 'git config user.name "Your Name" && git config    user.email "your@address.com"'

.... see rest here : https://gist.github.com/carlosmcevilly/2221249

ps: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

Example output:

enter code here

user.email=abarker@cern.ch
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

Need Your Help

How to extract the title image of the web page

asp.net html regex page-title asp.net-webpages

I want to extract the title image of a web page using C# in ASP.NET. I checked the windows and document objects but they don't have a property such as title. So searching for method to extract the ...

MongoDb Update only one value from array

php arrays mongodb laravel jenssegers-mongodb

I have a collection in mongodb which looks like this.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.