- clone the repo into a new directory
- cd into it
git filter-branch --prune-empty --subdirectory-filter FOLDER-NAME BRANCH-NAME- where:
FOLDER-NAME: The folder within your project that you'd like to create a separate repository from.BRANCH-NAME: The default branch for your current project, for example,master.
- Update the remote
git remote set-url origin https://github.com/USERNAME/NEW-REPOSITORY-NAME.git - Verify
git remote -v - Push the changes
git push -u origin BRANCH-NAME
- Delete a branch 'git branch -d NAME'
- adding
git submodule add REPO - to pull new code:
git pull --recurse-submodules