Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fahadsiddiqui/ca3da05fff20c8dcc93a53aeec7f293f to your computer and use it in GitHub Desktop.
Save fahadsiddiqui/ca3da05fff20c8dcc93a53aeec7f293f to your computer and use it in GitHub Desktop.
Change commit history using `filter-branch`.
#!/usr/bin/env bash
git filter-branch \
--env-filter \
'
CORRECT_NAME="Joe"
CORRECT_EMAIL="[email protected]"
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
export GIT_AUTHOR_NAME="$CORRECT_NAME"
export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
' \
--tag-name-filter \
cat -- \
--branches \
--tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment