Skip to content

Instantly share code, notes, and snippets.

@marschhuynh
Created January 26, 2021 09:07
Show Gist options
  • Save marschhuynh/a939fabf7cf92e9f116dcb09771b2382 to your computer and use it in GitHub Desktop.
Save marschhuynh/a939fabf7cf92e9f116dcb09771b2382 to your computer and use it in GitHub Desktop.
reset-commit-author
git filter-branch --force --commit-filter '
          if [ "$GIT_COMMITTER_EMAIL" = "wrong@email.com" ];
          then
                  export GIT_COMMITTER_NAME="New Name";
                  export GIT_AUTHOR_NAME="New Nam";
                  export GIT_COMMITTER_EMAIL="new@example.com";
                  export GIT_AUTHOR_EMAIL="new@example.com";
          fi;
          git commit-tree "$@"
  ' --tag-name-filter cat -- --all
@kingtran2112
Copy link

Work like a charm 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment