Skip to content

Instantly share code, notes, and snippets.

@MichaelBlume
Created April 10, 2011 23:54
Show Gist options
  • Save MichaelBlume/912865 to your computer and use it in GitHub Desktop.
Save MichaelBlume/912865 to your computer and use it in GitHub Desktop.
Script for orphaning a single commit. Useful in conjunction with .git/info/grafts
git filter-branch -f --parent-filter '
if [ "$GIT_COMMIT" = "SHA_GOES_HERE" ];
then
echo ''
else
read parents;
echo $parents;
fi' -- --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment