Skip to content

Instantly share code, notes, and snippets.

@Billy-
Created October 10, 2018 19:35
Show Gist options
  • Save Billy-/bf86043cf597f6613a44ec9bf16b3d93 to your computer and use it in GitHub Desktop.
Save Billy-/bf86043cf597f6613a44ec9bf16b3d93 to your computer and use it in GitHub Desktop.
Rewrite commit authors
# "borrowed" from https://stackoverflow.com/a/23564785/1879895
git filter-branch --commit-filter \
'if [ "$GIT_AUTHOR_NAME" = "OldAuthor Name" ]; then \
export GIT_AUTHOR_NAME="Author Name";\
export GIT_AUTHOR_EMAIL=authorEmail@example.com;\
export GIT_COMMITTER_NAME="Commmiter Name";\
export GIT_COMMITTER_EMAIL=commiterEmail@example.com;\
fi;\
git commit-tree "$@"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment