Changing git authorship after git push
You will have to amend the commit ( git commit --amend --author="New Author Name <email@address.com>"
) on your local repository and force push- git push -f
the change ( rewriting history is generally a bad practice once you have pushed upstream ).
Another complete solution.
In case you got multiple git-push done without realizing that the commits went with a different email account. now you need to change that.here is the command I have used to transform all my previous commit with a different email to the new email id.
git filter-branch -f --env-filter "GIT_AUTHOR_NAME='yourname'; GIT_AUTHOR_EMAIL='youremail@example.com'; GIT_COMMITTER_NAME='yourname'; GIT_COMMITTER_EMAIL='youremail@example.com';" HEAD;