1

When I commit a file from git in terminal to a branch, it shows the commit as being done by my real name. Where is it getting my name from, and how do I change it to show my username? In my Github settings I don't have a Name set, and git config --get user.name returns my github username.

numbermaniac
  • 788
  • 1
  • 13
  • 28

1 Answers1

4

When I commit a file from git in terminal to a branch, it shows the commit as being done by my real name

This is set from the config user.name and user.email

In your repo, make sure to make:

git config user.name <yourGitHubAccountName>
git config user.email <yourGitHubAccountEmail>

Then make new commits, and see with git log if their author/email is the correct one.


Note: as I mentioned in "How do I make git block commits if user email isn't set?", I prefer setting:

git config --global user.useConfigOnly true

That will avoid having git trying to guess your username when a local user.name is not set.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250