Wednesday, February 17, 2016

Truncating Git History

Look, sometimes you want to be a revisionist, and the only way to get rid of a pesky diff that is taking a lot of commit time is to truncate the commit log. So in the rare occasion you need to do it here is how.

Create a Truncate Script


Use the Commit Sha to Truncate To

source ~/data/bin/git-truncate a71f4386f9d5e3b707067e66fd5f76a1cc06c11c

Force the Push to Origin

git push origin master --force

No comments: