Git: changing global user name and user email

How to set the global user name and user email for git?

asked Jan 19, 2013 by forum (2,150 points)

1 Answer

 
Best answer

We may be asked to set our global user name and user email if it is the first time that we use git on a machine:

Your name and email address were configured automatically based on
your username and hostname. Please check that they are accurate. You
can suppress this message by setting them explicitly:

git config --global user.name "Your Name"
git config --global user.email you@example.com

If the identity used for this commit is wrong, you can fix it with:

git commit --amend --author='Your Name <you@example.com>'

However, no message tells us how to update these information (of course, git does not know that we want to change). To change the configurations, the same scripts can be used:

$ git config --global user.name "Your Name"
$ git config --global user.email you@example.com

# fix wrong identity
$ git commit --amend --author='Your Name <you@example.com>'
answered Jan 20, 2013 by SA (14,760 points)
selected Jan 20, 2013 by SA

Please log in or register to answer this question.

Related questions

1 answer
asked Apr 7, 2015 by harryxiyou (5,830 points)
1 answer
1 answer
asked Oct 24, 2015 by harryxiyou (5,830 points)
1 answer
1 answer
asked Jun 17, 2015 by harryxiyou (5,830 points)
1 answer
Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...