When doing things via the web interface of GitHub such as merging pull requests or working on gh-pages, the author of the commit is:
real name <email@address>
but I would like it to be:
username <email@address>
Is there a way to change this?
When working on my local repo and push from here, everything is as expected.
Edit
Here are some simple steps to reproduce the issue:
$ git log
and notice that the real name was used for the commit done in GitHub, and not the usernameHere is a test repo (I will delete it again later): https://github.com/puce77/test
Edit 2
Or is it recommended to use the real name? For what reason? I think the username is unique but the real name might be not. Also real names change more likely (eg. marriage) than usernames.
You should use your real name. My lab has a private GitHub group for internal stuff, as well as a few open public-facing projects. Everyone in our group uses their real names or some transparent abbreviation (like jsmith ) or one that matches their university email/login ID.
Your question:
How to use username as author instead of real name in GitHub?
You are looking for a bad practice.
Answer:
Manually way
# For global configuration on your PC.
git config --global user.name "your_username"
# For local configuration on your client repository
git config --global user.name "your_username"
(this is bad practice)
Original best practice,
# For global configuration on your PC.
git config --global user.name "Your fullname"
# For local configuration on your client repository
git config --global user.name "Your fullname"
Automatic way: No solution existing, and Git or GitHub don't recommend this, (a simple logic, when GitHub has email address, GitHub can inferring according account's username.
Find your information: Let's type command
git config --list
you will see, the Git designers didn't recommend, or design an information field for username, just user.name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With