Skip to content

Instantly share code, notes, and snippets.

@gemanepa
Last active May 12, 2020 15:47
Show Gist options
  • Select an option

  • Save gemanepa/98283c2c37e22b864e54d46a42e05e5d to your computer and use it in GitHub Desktop.

Select an option

Save gemanepa/98283c2c37e22b864e54d46a42e05e5d to your computer and use it in GitHub Desktop.

Revisions

  1. gemanepa renamed this gist May 12, 2020. 1 changed file with 1 addition and 1 deletion.
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    In terminal, introduce ->
    #!/bin/bash

    git filter-branch --env-filter '
  2. gemanepa renamed this gist May 12, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. gemanepa created this gist May 12, 2020.
    19 changes: 19 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    In terminal, introduce ->

    git filter-branch --env-filter '

    OLD_EMAIL="[email protected]"
    CORRECT_NAME="Your Correct Name"
    CORRECT_EMAIL="[email protected]"

    if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
    then
    export GIT_COMMITTER_NAME="$CORRECT_NAME"
    export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
    fi
    if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
    then
    export GIT_AUTHOR_NAME="$CORRECT_NAME"
    export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
    fi
    ' --tag-name-filter cat -- --branches --tags