Skip to content

Instantly share code, notes, and snippets.

@spectra
Last active October 1, 2015 19:27
Show Gist options
  • Save spectra/ebaa76c13e3a9ef2a469 to your computer and use it in GitHub Desktop.
Save spectra/ebaa76c13e3a9ef2a469 to your computer and use it in GitHub Desktop.
Change the author name/email of a single commit
#!/bin/bash
# Change the Author Name/Email of a single commit
git filter-branch --commit-filter '
if [ "$GIT_COMMIT" = "commit-hash-here" ]; then
GIT_AUTHOR_NAME="New Author Name";
GIT_AUTHOR_EMAIL="New Author Email";
git commit-tree "$@";
else
git commit-tree "$@";
fi' HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment