Git: how to split a repo

You can use this command to split out a dir from a repo

git filter-branch --subdirectory-filter folder_to_split_out/ -- master

If you want tor remove a file or a folder from a repo:

git filter-branch --index-filter "git rm -r --cached --ignore-unmatch file_to_remove" --prune-empty