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.
Asked
Active
Viewed 1,758 times
1

numbermaniac
- 788
- 1
- 13
- 28
-
what does `git config --list` tell you? Can you locate your full name there? – Chris Maes Jun 02 '16 at 07:39
-
you can also look in ~/.gitconfig (global config) and .git/config (repository config) – Chris Maes Jun 02 '16 at 07:40
-
Looked at .gitconfig and `git config --list`, neither have my real name. – numbermaniac Jun 02 '16 at 07:51
1 Answers
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.