How to update git commit author, but keep original date when amending?

Here’s how to do it with rebase and keep both the commit date and the author date:

git -c rebase.instructionFormat="%s%nexec GIT_COMMITTER_DATE="%cD" GIT_AUTHOR_DATE="%aD" git commit --amend --no-edit --reset-author" rebase -f <commit/branch before wrong author and email, or --root to rebase all>

Based off this Reddit thread.

Leave a Comment