Skip to content

Instantly share code, notes, and snippets.

@abhishekpatel946
Last active November 5, 2022 11:35
Show Gist options
  • Save abhishekpatel946/daaa9e689a02969dcba64fa44eb105ef to your computer and use it in GitHub Desktop.
Save abhishekpatel946/daaa9e689a02969dcba64fa44eb105ef to your computer and use it in GitHub Desktop.
Change the auther details(like author_name, author_email) from previous commits in a single command. (NOTE: Make it a singlural line before paste on terminal)
git filter-branch --env-filter 'if [ "$GIT_AUTHOR_EMAIL" = "<INCORRECT-EMAIL>" ];
then GIT_AUTHOR_EMAIL=<CORRECT-EMAIL>;
GIT_AUTHOR_NAME="<CORRECT-AUTHOR-NAME>";
GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL;
GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; fi' -- --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment