5

I use Git on Windows and set the username and email with:

git config --global user.name "hydRAnger"
git config --global user.email "armyiljfe@gmail.com"

When I use:

git config --global --list

I get the output:

user.name=hydRAnger
user.email=armyiljfe@gmail.com

However, when I use git log the author info should be:

Author: hydRAnger <armyiljfe@gmail.com>

But in fact I get the output:

Author: unknown <hydRAnger@hydRAnger-PC.(none)>

I don't know why the author information incorect.

animuson
  • 53,861
  • 28
  • 137
  • 147
hydRAnger
  • 3,013
  • 3
  • 18
  • 20

2 Answers2

6

Setting the user.name and user.email config options does not change already existing commits. It will only work for future commits.

If you also want to rewrite existing commits to use the new user data check out this question:

Change the author and committer name and e-mail of multiple commits in Git

Community
  • 1
  • 1
Koraktor
  • 41,357
  • 10
  • 69
  • 99
  • See also [Is there a way to override a git author's display name](http://stackoverflow.com/q/8878615/11343) for an alternative way to do this – CharlesB Jan 30 '12 at 13:02
3

Did you reset the author on your commit after updating your details?

git commit --amend --reset-author

(This will bring up the commit message again - you can just leave it intact)

James M
  • 18,506
  • 3
  • 48
  • 56