Skip to content

Instantly share code, notes, and snippets.

@niczero
Created November 11, 2015 14:28
Show Gist options
  • Save niczero/6b5294228c14002e0acf to your computer and use it in GitHub Desktop.
Save niczero/6b5294228c14002e0acf to your computer and use it in GitHub Desktop.
Extract a subtree of git repo to make a new repo
# Want to remove all reference to lib/* except lib/Minion/Backend/*
git filter-branch --tag-name-filter cat \
--index-filter 'git rm --cached -qr -- lib && git reset -q $GIT_COMMIT -- lib/Minion/Backend t' \
--prune-empty \
-- --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment