2

Most likely an easy question here. When I share a github link, my full name is displaying in the bar that contains the commit message. I would like to change that to be just my username. I've been over the settings and I can't seem to find where to change that in the display.

Is it pulling my name from the origin and if so, is it possible to set a username alias from the command line? Or is this a setting within the github user profile that I am simply overlooking?

Any help would be appreciated. Thank you.

MarquisMark
  • 37
  • 1
  • 7
  • This is already answered: https://stackoverflow.com/questions/1746562/github-shows-name-instead-of-a-linked-username-in-commits – Slava Medvediev May 06 '20 at 05:50

1 Answers1

2

GitHub associates your username with a commit by the email addresses associated with your account. So if the commit email address is associated with a GitHub account, that account will be used. If there's no account associated with that email, the full name as listed in the commit will be used instead.

So you can either rewrite your commits to use a different email address and force push over the existing commits or associate the given email address with your account in the GitHub settings (and verify that email address) if you want them to be associated with your username.

bk2204
  • 64,793
  • 6
  • 84
  • 100
  • I do have an email listed as my Primary under the Email settings. Is there another place I need to have that associated? – MarquisMark May 06 '20 at 02:22
  • It's not that you have to have _an_ email, it's that the email _you use in your commits_ (usually the setting of `user.email`, which you can see with `git config -l`) has to be associated with your GitHub account. – bk2204 May 06 '20 at 02:24
  • Okay, I understand now. Thank you. And I also see that this question has come up before. Cheers. – MarquisMark May 06 '20 at 07:01