git submodule svn external

后端 未结 2 689
遥遥无期
遥遥无期 2020-12-18 09:39

Let\'s say I have 3 git repositories, each with a lib and tests folder in the root. All 3 repositories are part of what I want to be a single packa

2条回答
  •  有刺的猬
    2020-12-18 10:07

    You can have a forth 'lib' main Git repo, with:

    • lib/vendor/package content
    • 3 submodules (see "true nature of submodules")

    But this reference is totally independent from any 'svn:external' property you may have setup in a mirror SVN repo.

    So if you have 3 SVN repos already, you can git-svn them, publish them on GitHub, and then create a fourth repo on GitHub in which you will add those 3 Git repos as submodules, following the submodules tutorial (supposing here you have all 4 repos already on GitHub)

    $ mkdir -p lib/vendor/package
    $ cd lib/vendor/package
    $ for package in a b c d; do
    $ git submodule add git://github.com/path/to/$package.git $package
    $ done
    $ cd ..
    $ git commit -m "lib with submodules"
    $ git push
    

提交回复
热议问题