dvi*_*ino 59 git mercurial git-submodules
我很高兴使用子模块来跟踪我的项目所依赖的所有库.问题是我正在使用一个名为core-plot的库,它只有一个公共的mercurial存储库.我可以在一个只读的Git存储库中镜像它,但这是我得到的最佳选择吗?我曾经看到Mercurial中有模块来跟踪Git中的内容.有人知道是否存在相反的方式?
Jim*_*unt 25
使用git-hg.
首先,确保主存储库下有一个(非Mercurial)git子模块.如果您还没有其他子模块,只需为某些库创建一个虚拟子模块core-plot,例如:
main-repo $ git submodule add https://repo.url.com/repo.git repo
Run Code Online (Sandbox Code Playgroud)
其次,将库克隆core-plot到某个目录中.
main-repo $ git-hg clone https://code.google.com/p/core-plot/ core-plot
Run Code Online (Sandbox Code Playgroud)
将新repo添加到子模块列表中.
main-repo $ git submodule add ./core-plot core-plot
main-repo $ git commit -am "added core-plot submodule"
Run Code Online (Sandbox Code Playgroud)
从现在开始,来自此repo的任何克隆都将拉出两个存储库.(在子模块初始化和更新后).
到目前为止我发现的一些问题是:
git-hg必须git-hg pull.来自Hg repo的相反问题git子模块?在StackOverflow上也会被问到.最好的答案提到项目hg-git和git-hg.另一个相关的相反问题是,如何处理转换为Mercurial的repo上的Git子模块.
phi*_*nze 15
根据我的经验,大多数活跃的非git项目都有一个最新的git镜像在GitHub上浮动.它看起来也core-plot有一个:
https://github.com/djw/core-plot
如果你愿意依赖那些设置了镜像的人,看起来这可能是获得子模块的最简单方法.
| 归档时间: |
|
| 查看次数: |
9875 次 |
| 最近记录: |