Skip to content

Instantly share code, notes, and snippets.

@iamsahilsonawane
Forked from bgromov/git-reset-author.sh
Last active June 24, 2022 01:30
Show Gist options
  • Select an option

  • Save iamsahilsonawane/a5ba6faaecaad39e3ae0133ca43a5c7d to your computer and use it in GitHub Desktop.

Select an option

Save iamsahilsonawane/a5ba6faaecaad39e3ae0133ca43a5c7d to your computer and use it in GitHub Desktop.
Git: Reset author for all commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Sahil Sonawane'
GIT_AUTHOR_EMAIL='[email protected]'
GIT_COMMITTER_NAME='Sahil Sonawane'
GIT_COMMITTER_EMAIL='[email protected]'
" HEAD
@iamsahilsonawane
Copy link
Author

Single liner for ZSH

git filter-branch -f --env-filter "GIT_AUTHOR_NAME='Sahil Sonawane';GIT_AUTHOR_EMAIL='[email protected]';GIT_COMMITTER_NAME='Sahil Sonawane';GIT_COMMITTER_EMAIL='[email protected]';" HEAD

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