search

Wednesday, October 7, 2015

git: How to change the author of the commit

If you want to change the author of the specific commit (for example the latest one), run rebase command:
git rebase -i HEAD~1
HEAD~1 points to the latest commit, but it can be a commit id or branch name. To mark a commit for edit, replace `pick` with `e`: Replace commit author:
git commit --amend --author "Your Name <your.name@mail.com>" 
Finish rebase:
git rebase --continue

No comments:

Post a Comment