Skip to content

Instantly share code, notes, and snippets.

@quend
Last active August 29, 2015 14:22
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 quend/ed43baf6512d8b2fecad to your computer and use it in GitHub Desktop.
Save quend/ed43baf6512d8b2fecad to your computer and use it in GitHub Desktop.
example:
want to change commit hash in remote: 12345678
locally in your pulled repo. you are on the master branch, run the following:
git checkout 12345678
git commit --amend --author "AUTHOR_NAME <AUTHOR_EMAIL>"
==> get the commit hash printed after you run this (i.e. 87654321)
git replace 12345678 87654321
git filter-branch -f -- --all
git replace -d 12345678
git push -f origin master
git checkout master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment