Skip to content

Instantly share code, notes, and snippets.

@imjamesdotme
Last active October 28, 2015 21:23
Show Gist options
  • Save imjamesdotme/8ca2281ad15f61037b41 to your computer and use it in GitHub Desktop.
Save imjamesdotme/8ca2281ad15f61037b41 to your computer and use it in GitHub Desktop.
change-git-author-info-for-all-commits

The following bash script will change the author information for all commits in a repo. Becareful using this on public repos!

#!/bin/sh
git filter-branch -f --env-filter "GIT_AUTHOR_NAME='newName'; GIT_AUTHOR_EMAIL='newEmail'; GIT_COMMITER_NAME='newName'; GIT_COMMITTER_EMAIL='newEmail';" HEAD

Once this has run successfully (you can check this by running 'git log' and press wq to exit the log). Run the following git command:

git push -f origin master

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