I have a very old project that includes the source from another project directly, instead of linking it as a library. Back in the bad days, when I was keeping everything in CVS, I had the external code on a vendor branch and did periodic imports. Now that my project is in git it would make more sense to include the external project as a submodule. But, there's a problem: the external project has migrated to Mercurial. I've found the git-hg and hg-git projects, but I'm not sure if either one handles submodules properly.
Is there a way to create a git submodule that points to an Hg repo instead of a git repo?
Since the hg-git does mention that submodules are not supported yet, that leaves only a manual option:
hg gpush
from within your project. For example:
$ cd hg-git # (an Hg repository)
$ hg gremote add origin [email protected]/schacon/hg-git.git
$ hg gpush
That Git repo will represent your submodule, but if you modify and push that submodule, you will still have to pull from that Git repo to the actual Hg repo.
Other great git-hg commands are listed in this "rosetta stone".
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