I have a very long list of repos that I'm trying to make into one parent repo by making them all submodules.
I've tried adding them to .gitmodules
manually, and also to .git/config
, but it doesn't seem to work.
I've also tried running git submodule sync
and git submodule update --init
, etc, but with no luck.
Is there a way to trick git into thinking my project has all its (~30K) submodules, without actually needing to clone them all?
After a long walk on the internet, I found out that you can achieve what you want by writing directly in the git index and create the “gitlink” file type.
git update-index [--add] --cacheinfo 160000 <subrepo commit hash> <submod path>
Also do not forget to write the subrepo in .gitmodules
(declare the external path, mostly).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With