Reputation: 43401
So I'm having this project where some parts have been developed in the main repo but can be moved to an independently developed sub-module :
./ ← repo root
├── client-angular/
│ └── whatever/
├── resources/
│ └── script/ ← wanna be sub-module
└── server-codeigniter/
How can I make the script/
directory into a git submodule with minimal effort ?
It is currently tracked by the main repo.
Upvotes: 3
Views: 853
Reputation: 1324093
Once you have extracted the sub-folder in its own repo (as explained in "Detach (move) subdirectory into separate Git repository"), you will still have to:
git rm -r resources/script
and add the remote new repo as a submodule
git submodule add /url/new/repo resources/scripts
Upvotes: 2