I have my own remote repo but I want to push to it using my name and surname and not my nick. However, none of git config
options worked for me.
-
1Do you want to have name and surname to be visible in the commit details? – Dominik Wosiński Apr 07 '19 at 11:18
-
I want my commit to be visible in Github page as e.g `John Doe` not `JohnDoe11` – TomKo1 Apr 07 '19 at 11:20
-
I managed to change the author in `logs` however it is not reflected on the Github page. – TomKo1 Apr 07 '19 at 11:20
2 Answers
If You want to do this only for the last commit, You can reset the branch to the state before the mentioned commit, set proper details usinggit config
and then make a commit and force push the last commit to the repo.
If however You would like to do this for multiple commits, then it is a little bit harder and requires rewriting the history. The script to do this has already been provided on StackOverflow: How to change the author and committer name and e-mail of multiple commits in Git?.

- 3,769
- 1
- 8
- 22
-
Yes, also see [this](https://help.github.com/en/articles/changing-author-info) on GitHub. – Romain Valeri Apr 07 '19 at 11:30
GitHub shows the author and committer username as specified in Git (e.g. John Doe) only if there is no user associated with the given email address. If you want your name to show up as it is in Git's configuration and not as a username, then you need to use an email address for committing that is not associated with your account.
Note that if you do this, nothing on GitHub will consider your account the author, so you won't get credit for it in contribution graphs and such.

- 64,793
- 6
- 84
- 100