Skip to content

Instantly share code, notes, and snippets.

View ahcode0919's full-sized avatar
🏠
Working from home

A. Hinton ahcode0919

🏠
Working from home
  • Worldwide
View GitHub Profile
@ahcode0919
ahcode0919 / git-author-rewrite.sh
Last active May 7, 2018 01:41 — forked from octocat/git-author-rewrite.sh
Simple script for updating the commit author in a repository across all branches
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="OLD EMAIL ADDRESS"
CORRECT_NAME="NEW NAME"
CORRECT_EMAIL="NEW EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"