tags:

views:

135

answers:

2

I'm using a few repository which I do not host myself and I thinking what if I deploy my application while they are not available? This simply just can't happen.

Is there a way to "freeze" the submodule somehow that when I pull from my repository the submodules are already init and update?

Any help is appreciated.

+2  A: 

I'm using a few repository which I do not host myself and I thinking what if I deploy my application while they are not available? This simply just can't happen.

Host your own mirrors of those repositories by cloning them, and use your mirrors as the submodules.

Ben James
I thought of it but I was hoping there were something in git that allowed to do it.
philhq
+1  A: 

If you have no intention of tracking the development in the submodule'd repository, why set it up? Submodules are for when you want to track the external development of a repository separately from your own. I would simply checkout whatever commit you want to "freeze" it at, and commit it to your main repository. This can be done using the subtree merge strategy, which is more geared towards incorporating an external repository and then working with the entire history of the combined repositories together.

That having been said, when you are deploying/releasing, I wouldn't rely on external repositories and your bleeding-edge development sources anyways and simply rolling a release archive/tarball/executable/however you release - and since you've already got the submodule source yourself, it becomes a non-issue, though this problem is also mitigated by the subtree merge strategy in any case.

Matt Enright