Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make some submodules optional in git

We have a git repo that is serving multiple projects/targets. In addition there are 3 submodules for separately developed modules that are referenced and pulled into the workspace.

Are are going to have a 4th repo for a module that will be needed only for a specific project and only specific engineers have permissions to access it. Is there any way to make this 4th submodule optional or it's all-or-nothing?

Thanks a lot,

Guy.

like image 705
Guy Cohen Avatar asked May 17 '18 14:05

Guy Cohen


1 Answers

You can use something like following in your .gitmodules:

[submodule "secrets"]
    path = secrets
    url = ./secrets

Then, after checkout, you can clone the optional repositories like:

rm -rf secrets
git clone git://... secrets
like image 99
Eduardo Cuomo Avatar answered Sep 26 '22 14:09

Eduardo Cuomo