Skip to content

Instantly share code, notes, and snippets.

@disfinder
Forked from bgromov/git-reset-author.sh
Last active May 4, 2020 03:05
Show Gist options
  • Save disfinder/dc93ff662dfea419e47ea309c98062f3 to your computer and use it in GitHub Desktop.
Save disfinder/dc93ff662dfea419e47ea309c98062f3 to your computer and use it in GitHub Desktop.
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
CURRENT_NAME=$(git config --get user.name)
CURRENT_EMAIL=$(git config --get user.email)
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='${CURRENT_NAME}'
GIT_AUTHOR_EMAIL='${CURRENT_EMAIL}'
GIT_COMMITTER_NAME='${CURRENT_NAME}'
GIT_COMMITTER_EMAIL='${CURRENT_EMAIL}'
" HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment