Skip to content

Instantly share code, notes, and snippets.

@daltonnyx
Forked from marschhuynh/reset-commit-author.md
Created January 26, 2021 09:21
Show Gist options
  • Select an option

  • Save daltonnyx/b46539a40df2a57c3e9c24329d3b3c83 to your computer and use it in GitHub Desktop.

Select an option

Save daltonnyx/b46539a40df2a57c3e9c24329d3b3c83 to your computer and use it in GitHub Desktop.

Revisions

  1. @marschhuynh marschhuynh created this gist Jan 26, 2021.
    12 changes: 12 additions & 0 deletions reset-commit-author.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    ```bash
    git filter-branch --force --commit-filter '
    if [ "$GIT_COMMITTER_EMAIL" = "[email protected]" ];
    then
    export GIT_COMMITTER_NAME="New Name";
    export GIT_AUTHOR_NAME="New Nam";
    export GIT_COMMITTER_EMAIL="[email protected]";
    export GIT_AUTHOR_EMAIL="[email protected]";
    fi;
    git commit-tree "$@"
    ' --tag-name-filter cat -- --all
    ```