34

I am getting this warning when I try to set my user name in Tower:

warning: user.name has multiple values

I have checked in a terminal window and found that I have three usernames:

macmini:HiBye shannoga$ git config --get-all user.name Shani shani shani 

How can I delete two of the user names?

8 Answers 8

40

Use git config -e and you should see something like:

[user] name = Shani name = shani name = shani 

Delete the lines you don't want.

Sign up to request clarification or add additional context in comments.

5 Comments

Hi I am new to git, what do you mean "delete the redundant lines"? can you be more deatailed
When I set these values from cmd-line it wasn't working - had multiple values, some blank. . must be a bug/config issue in my git version. . . editing the file worked.
@AlonL please don't radically change a post, instead write your own answer. See this meta discussion for reference.
This (very old post) doesn't work for me now, but I get the same output noted above with git config --global --edit
This changes the local configuration for a specific git project, right? How can you do this for your whole system? git config --global --edit only gives me nothingness.
25

This worked for me on my Mac:

git config --global --unset-all user.name 

Comments

9

The older answers above didn't work for me either anymore: in addition to editing the .gitconfig file directly, you can just run

git config --global --edit 

and make your changes there.

Comments

5

If you want to replace the wrong ones with the proper one:

git config --global --replace-all user.name "FName LName" 

same applies for user mail:

git config --global --replace-all user.mail "[email protected]" 

Comments

2

i had the same issue, i thought it had something to do with the ssh key, after removing both, nothing happened but this one worked for me:

git config --global --edit 

Comments

1

Note: with git1.8.1rc1 (December 2012), the logic is different;

"git config --get" used to diagnose presence of multiple definitions of the same variable in the same configuration file as an error, but it now applies the "last one wins" rule used by the internal configuration logic.

Strictly speaking, this may be an API regression but it is expected that nobody will notice it in practice.

Comments

0

The above answers didn't work for me. Edit the .gitconfig file in your home directory. This is your global configuration.

Go to the home directory:

cd ~ 

edit .gitconfig

[user] name = Your Name email = [email protected] 

Comments

0

If updating email address and password in your config file didn't help then probably you might be using this account with your machine for the first time. Generating and assosiating the pass phrase key with your account helps.

References :

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.