Skip to content

Instantly share code, notes, and snippets.

@pathawks
Forked from jeresig/gist:199298
Last active December 20, 2015 19:59

Revisions

  1. pathawks revised this gist Aug 14, 2013. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions Change Author.sh
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,6 @@
    #!/bin/sh
    # Rename an email address in all old commits.
    # WARNING: Will change all your commit SHA1s.
    # Based off of the script from here:
    # http://coffee.geek.nz/how-change-author-git.html

    git filter-branch -f --env-filter '
  2. pathawks revised this gist Aug 14, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Change Author.sh
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    # http://coffee.geek.nz/how-change-author-git.html

    git filter-branch -f --env-filter '
    an="$GIT_AUTHOR_NAME"
    am="$GIT_AUTHOR_EMAIL"
    cn="$GIT_COMMITTER_NAME"
  3. pathawks revised this gist Aug 14, 2013. 1 changed file with 27 additions and 21 deletions.
    48 changes: 27 additions & 21 deletions Change Author.sh
    Original file line number Diff line number Diff line change
    @@ -5,33 +5,39 @@
    # http://coffee.geek.nz/how-change-author-git.html

    git filter-branch -f --env-filter '
    an="$GIT_AUTHOR_NAME"
    am="$GIT_AUTHOR_EMAIL"
    cn="$GIT_COMMITTER_NAME"
    cm="$GIT_COMMITTER_EMAIL"
    case "$GIT_AUTHOR_NAME" in
    oldname)
    an="newname"
    am="[email protected]"
    ;;
    plugin-master)
    an="plugin-master"
    am="[email protected]"
    ;;
    esac
    case "$GIT_COMMITTER_NAME" in
    oldname)
    cn="newname"
    cm="[email protected]"
    ;;
    if [ "$GIT_AUTHOR_NAME" = "***Old Name***" ]
    then
    an="***New Name***"
    am="[email protected]"
    fi
    if [ "$GIT_COMMITTER_NAME" = "***Old Name***" ]
    then
    cn="***New Name***"
    cm="[email protected]"
    fi
    plugin-master)
    cn="plugin-master"
    cm="[email protected]"
    ;;
    if [ "$GIT_AUTHOR_NAME" = "plugin-master" ]
    then
    an="plugin-master"
    am="[email protected]"
    fi
    if [ "$GIT_COMMITTER_NAME" = "plugin-master" ]
    then
    cn="plugin-master"
    cm="[email protected]"
    fi
    esac
    export GIT_AUTHOR_NAME="$an"
    export GIT_AUTHOR_EMAIL="$am"
  4. pathawks revised this gist Aug 14, 2013. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions Change Author.sh
    Original file line number Diff line number Diff line change
    @@ -38,5 +38,3 @@ git filter-branch -f --env-filter '
    export GIT_COMMITTER_NAME="$cn"
    export GIT_COMMITTER_EMAIL="$cm"
    '

    git push --force
  5. pathawks revised this gist Aug 13, 2013. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Change Author.sh
    Original file line number Diff line number Diff line change
    @@ -38,4 +38,5 @@ git filter-branch -f --env-filter '
    export GIT_COMMITTER_NAME="$cn"
    export GIT_COMMITTER_EMAIL="$cm"
    '
    git push --force

    git push --force
  6. pathawks created this gist Aug 13, 2013.
    41 changes: 41 additions & 0 deletions Change Author.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,41 @@
    #!/bin/sh
    # Rename an email address in all old commits.
    # WARNING: Will change all your commit SHA1s.
    # Based off of the script from here:
    # http://coffee.geek.nz/how-change-author-git.html

    git filter-branch -f --env-filter '
    an="$GIT_AUTHOR_NAME"
    am="$GIT_AUTHOR_EMAIL"
    cn="$GIT_COMMITTER_NAME"
    cm="$GIT_COMMITTER_EMAIL"
    if [ "$GIT_AUTHOR_NAME" = "***Old Name***" ]
    then
    an="***New Name***"
    am="[email protected]"
    fi
    if [ "$GIT_COMMITTER_NAME" = "***Old Name***" ]
    then
    cn="***New Name***"
    cm="[email protected]"
    fi
    if [ "$GIT_AUTHOR_NAME" = "plugin-master" ]
    then
    an="plugin-master"
    am="[email protected]"
    fi
    if [ "$GIT_COMMITTER_NAME" = "plugin-master" ]
    then
    cn="plugin-master"
    cm="[email protected]"
    fi
    export GIT_AUTHOR_NAME="$an"
    export GIT_AUTHOR_EMAIL="$am"
    export GIT_COMMITTER_NAME="$cn"
    export GIT_COMMITTER_EMAIL="$cm"
    '
    git push --force