Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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