Skip to content

Instantly share code, notes, and snippets.

@fivemini
Created September 19, 2017 16:24
Show Gist options
  • Save fivemini/adc6cd6e2a47f9ee158c1e3770bf68ac to your computer and use it in GitHub Desktop.
Save fivemini/adc6cd6e2a47f9ee158c1e3770bf68ac to your computer and use it in GitHub Desktop.
git log --summary --pretty=full | less
git filter-branch --commit-filter '
if [ "$GIT_AUTHOR_EMAIL" = "oldname@users.noreply.github.com" ];
then
GIT_AUTHOR_NAME="newname";
GIT_AUTHOR_EMAIL="newname@users.noreply.github.com";
GIT_COMMITTER_NAME="newname";
GIT_COMMITTER_EMAIL="newname@users.noreply.github.com";
git commit-tree "$@";
else
git commit-tree "$@";
fi' HEAD
git reflog expire --expire=now --all
git gc --aggressive --prune=now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment