Skip to content

Instantly share code, notes, and snippets.

@cbfrance
Last active April 22, 2017 01:05
Show Gist options
  • Save cbfrance/e5eaf5dff1f234dd9a42b2899b5493e0 to your computer and use it in GitHub Desktop.
Save cbfrance/e5eaf5dff1f234dd9a42b2899b5493e0 to your computer and use it in GitHub Desktop.
Truncate a repo at an arbitrary point
git filter-branch --parent-filter '
read parent
if [ "$parent" = "-p <COMMIT ID>" ]
then
echo
else
echo "$parent"
fi'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment