How to change the author of a commit in GitHub?

Viewed 9565

I want to know if there is a way to change the person(account) who pushed changes in a GitHub repository.

For example: I push to my private repository under a different name(not email) but I misspell one letter of my name and GitHub marks the commit as commited by userame not username;

3 Answers

Easy Steps to Change Author Name of a Commit After Push.

  1. Rebase the repository to the previous commit of the one you want to change by running:1 git rebase –i {{previous-commit-hash}}

  2. The script above prompts you with a list of your commits in descendent order. On this vi/vim view, replace the word pick to edit per each commit you want to edit. Then quit and save.

  3. When the rebase process starts, change the author of a commit by running git commit --amend --author="Author ". Then, continue to next commit using: git rebase –continue

  4. Once the rebase process finishes, push your changes by running: git push -f The steps above will change the author of a commit.

Related