Skip to content

Instantly share code, notes, and snippets.

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

Aaron ahcodedev

🏠
Working from home
  • United States
View GitHub Profile
@ahcodedev
ahcodedev / 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"