git submodule from Hg repo?

前端 未结 1 604
攒了一身酷
攒了一身酷 2021-01-31 05:20

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,

相关标签:
1条回答
  • 2021-01-31 05:35

    Since the hg-git does mention that submodules are not supported yet, that leaves only a manual option:

    • setup a Git repository somewhere that you have push access to,
    • add it as a Git remote and then
    • run hg gpush from within your project.

    For example:

    $ cd hg-git # (an Hg repository)
    $ hg gremote add origin git@github.com/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".

    0 讨论(0)
提交回复
热议问题