-1

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.

Adrian
  • 16,233
  • 18
  • 112
  • 180
TomKo1
  • 214
  • 2
  • 14

2 Answers2

1

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?.

Dominik Wosiński
  • 3,769
  • 1
  • 8
  • 22
0

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.

bk2204
  • 64,793
  • 6
  • 84
  • 100