Change Wrong author email on commits pushed on remote git repository

I did forgot to set my username and email in git configuration and pushed my code to my remote repository. On searching for much time, i came to know working solution to change author email on commits already pushed on remote repository.

So, To Change Author name and email on commits pushed on remote repository, following command would help you.

git filter-branch python --env-filter \'if [ \"$GIT_AUTHOR_EMAIL\" = \"wrongmailid\" ]; then
GIT_AUTHOR_EMAIL=correctmailid;
GIT_AUTHOR_NAME=\"correctauthor\";
GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL;
GIT_COMMITTER_NAME=\"$GIT_AUTHOR_NAME\"; fi\' -- --all
%d bloggers like this: