10

If I committed to github with a wrong local credentials (username and password), will it be possible to change the committer name on github? This issue can happen if you have two git accounts! By the way I'n not asking how to reconfigure your local git account.

Amjad
  • 2,390
  • 2
  • 15
  • 18

2 Answers2

31

1- configure your new username and email with

change username: git config username.user <username>

change email: git config username.email <email>

2- run this command git commit --amend -C HEAD --reset-author

3- run this command git push --force

This will change the other in the last commit.

foobar
  • 133
  • 2
  • 7
6

You can change the last commit locally with

git commit --amend --author="Author Name <email@address.com>"

Then do a

git push --force

This will force the authored commit over the top of the old one.

hardillb
  • 47,764
  • 9
  • 59
  • 93