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='iamsahilsonawane@gmail.com'
GIT_COMMITTER_NAME='Sahil Sonawane'
GIT_COMMITTER_EMAIL='iamsahilsonawane@gmail.com'
" HEAD
@iamsahilsonawane
Copy link
Copy Markdown
Author

Single liner for ZSH

git filter-branch -f --env-filter "GIT_AUTHOR_NAME='Sahil Sonawane';GIT_AUTHOR_EMAIL='iamsahilsonawane@gmail.com';GIT_COMMITTER_NAME='Sahil Sonawane';GIT_COMMITTER_EMAIL='iamsahilsonawane@gmail.com';" HEAD

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