Git: change owner
If you want to rewrite all commits in branch just:
git filter-branch --commit-filter '
if [ "$GIT_AUTHOR_EMAIL" = "invalid-email@example.com" ];
then
GIT_AUTHOR_EMAIL="valid-email@example.com";
git commit-tree "$@";
else
git commit-tree "$@";
fi' HEAD
If you want to rewrite some commits in history just:
git rebase -i some-commit-hash
Then, mark as edit
/e
commits with invalid email. Save and exit from editor.
Repeat this command for all commits marked as edit
/e
.
git commit --amend --author="User Name <valid-email@example.com>" --no-edit
git rebase --continue
Read other posts