Skip to content

Instantly share code, notes, and snippets.

@dvdvck
Last active August 29, 2015 13:57
Show Gist options
  • Save dvdvck/9850565 to your computer and use it in GitHub Desktop.
Save dvdvck/9850565 to your computer and use it in GitHub Desktop.
An idea of how to split up some files in order to create a new repo

##Split some files out of repo keeping his history

In order to promote a subset of files to make an external library/module which will be contained by some package manager like npm.

This enable the reuse of this module in another repo using a package manager

git filter-branch -f --prune-empty --index-filter ' \
git ls-tree -r --name-only --full-tree $GIT_COMMIT | \
grep -v framebuffer | \
xargs -r git rm --cached -r --ignore-unmatch' -- --all
#to delete remote backup references
rm -r .git/refs/original
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment