Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save 4383/dcaf5b82040a222c09a8fb64c11b9578 to your computer and use it in GitHub Desktop.
Save 4383/dcaf5b82040a222c09a8fb64c11b9578 to your computer and use it in GitHub Desktop.
Change git commit author in project history
#!/bin/bash
git filter-branch --commit-filter '
if [ "$GIT_AUTHOR_NAME" = "Herve BERAUD" ];
then
GIT_AUTHOR_NAME="Hervé BERAUD";
GIT_AUTHOR_EMAIL="herveberaud.pro@gmail.com";
git commit-tree "$@";
if [ "$GIT_AUTHOR_EMAIL" = "herve.beraud@openmailbox.org" ];
then
GIT_AUTHOR_NAME="Hervé BERAUD";
GIT_AUTHOR_EMAIL="herveberaud.pro@gmail.com";
git commit-tree "$@";
else
git commit-tree "$@";
fi' HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment