This will rewrite the branch's commit history and is useful for combining users if two emails were used for a single user at any point.
Note: Since this edits all history, everyone will need to re-clone the repo in order to get the correct history on their local machines.
A list of users who committed can be viewed via git shortlog -s -n
.
$ git filter-branch --commit-filter '
if [ "$GIT_AUTHOR_EMAIL" = "jonViaDesktop@localhost" ];
then
GIT_AUTHOR_NAME="Jon Cardasis";
GIT_AUTHOR_EMAIL="myGitHubEmail@example.com";
git commit-tree "$@";
else
git commit-tree "$@";
fi' HEAD