git-cheatsheet
git-cheatsheet copied to clipboard
Rewrite git repo to keep only destinct subfolder
To rewrite the repository to look as if foodir/ had been its project root, and discard all other history:
git filter-branch --subdirectory-filter foodir -- --all
http://stackoverflow.com/a/811384/709769