Skip to content
This repository was archived by the owner on Dec 4, 2020. It is now read-only.

GitHub Fix invalid email address in Repository History

kadishmal edited this page Aug 13, 2011 · 6 revisions

Create a fix_repo.sh file in your repo:

cd my_repo
nano fix_repo.sh

And add the following code:

#!/bin/sh

git filter-branch --env-filter '

am="$GIT_AUTHOR_EMAIL"
cm="$GIT_COMMITTER_EMAIL"

if [ "$GIT_COMMITTER_EMAIL" = "none@none" ]
then
    cm="kadishmal@gmail.com"
fi
if [ "$GIT_AUTHOR_EMAIL" = "none@none" ]
then
    am="kadishmal@gmail.com"
fi

export GIT_AUTHOR_EMAIL="$am"
export GIT_COMMITTER_EMAIL="$cm"
'

Don't forget to leave the single quote (') at the end of the last line and at the end of the first line.

Set the file to be executable:

chmod a+x fix_repo.sh

Run the file:

./fix_repo.sh
Clone this wiki locally