Splitting a directory out to a standalone repository
This article explains a way how to split a directory out to a new Git repository.
Current Code Structure (Windows Environment)
├─UefiToolkitPkg
├─Application # This is should be a standalone repository
├─Drivers
├─Include
├─Library
├─Tools
└─...
Solution
- Splitting “Application” directory to a Git repository.
cd UefiToolkitPkg git subtree split -P Application -b Application
mkdir ..\Application
cd ..\Application
git init
git pull ..\UefiToolkitPkg Application
- Cleanup unnecessary files and optimize the local repository.
git gc --aggressive --prune=now
- Push to remote Git server.
git remote add origin https://github.com/xxx/Application.git git push -u origin master