windowsgit

Incorrect Git user name and email on Windows


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.


Solution

  • 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