Skip to content

Git: How do you amend the author of a previous commit? #80

Answered by rkotze
rkotze asked this question in Q&A
Discussion options

You must be logged in to vote

Amend author for the latest commit:

git commit --amend --no-edit --author="John Doe <[email protected]>"

Amend author of older commit messages using git rebase -i interactive mode. Provide a commit hash of the last good commit and then when the commit list shown in the editor change "pick" to "edit" for commits you want to change.

Step through each commit running the "--amend" flag followed by rebase continue. Repeat til done.

git rebase -i -p <commit_hash>

git commit --amend --no-edit --author="John Doe <[email protected]>"
git rebase --continue

Replies: 1 comment

Comment options

rkotze
Jun 18, 2022
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by rkotze
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant