Skip to content

Instantly share code, notes, and snippets.

@amaya382
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amaya382/595a2d9c8fc99819c289 to your computer and use it in GitHub Desktop.
Save amaya382/595a2d9c8fc99819c289 to your computer and use it in GitHub Desktop.
過去のcommitのユーザ名とメールアドレスを一括書き換え
git filter-branch -f --commit-filter '
if [ "$GIT_AUTHOR_EMAIL" = "{old email}" ];
then
GIT_AUTHOR_NAME="{new name}"
GIT_AUTHOR_EMAIL="{new email}"
GIT_COMMITTER_NAME="{new name}"
GIT_COMMITTER_EMAIL="{new email}"
git commit-tree "$@"
else
git commit-tree "$@"
fi' HEAD
# and then
git push -f origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment