Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×In Mercurial/Hg it is possible to make a copy of an external repository to your local server, and use this (local) repository as a subrepo in your project.
Using this method your project does not rely on external repositories, which can be down/moved/deleted/... , just on your local server.
I know the local copy must be updated manually, for Mercurial this was done using the server setting pages (as far as I can remember).
Is this also possible for Git?
Bitbucket allows you to fork an external repository into your workspace. This effectively is your own copy of the original. If the original repository gets deleted, your fork will still remain since it is decoupled once the fork is complete.
Git supports submodules. A submodule keeps track of an external repository and when you clone the top level repository with `--recurse-submodules` option, it will pull in changes from repositories pointed by the submodules in the top repository. However, this is done on your client and not on Bitbucket Cloud hosting side.
If you want to maintain copies of external dependencies to avoid surprises when they get deleted, forking them is your best option. However, you will have to keep updating your forks from the original to keep them in sync.
I already understand the submodules principle.
But I think the result is:
Fork to a repository and have this repository stored on your bitbucket server.
Now use this forked repository as submodules in one or (git) projects.
I do not know whether possible, but this is also not my desire to achieve: When able to use a submodule as a fork, this would imply my project clone would contain the (full) forked submodule...
So fork to a (new) repository and use this repository as a submodule in your project.
Some googled usefull, and maybe not fully related links:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.