如何处理转换为 Mercurial 的存储库上的 Git 子模块
事情是这样的:
$ cat .gitmodules
[submodule "utils/external/firepython"]
path = utils/external/firepython
url = git://github.com/darwin/firepython.git
[submodule "utils/external/textile"]
path = utils/external/textile
url = git://github.com/jsamsa/python-textile.git
虽然这仍然是一个 Git 存储库,但我需要运行 git submodule init ,之后一些神奇的事情发生了。由于我现在已将存储库转换为 Mercurial(使用 hgext.git
扩展),我不知道该怎么做。是否有等效的流程(我的 Mercurial 存储库中需要这 2 个 Git 模块)?
Here goes:
$ cat .gitmodules
[submodule "utils/external/firepython"]
path = utils/external/firepython
url = git://github.com/darwin/firepython.git
[submodule "utils/external/textile"]
path = utils/external/textile
url = git://github.com/jsamsa/python-textile.git
While this was still a Git repo, I needed to run git submodule init
, after which some magic happens. Since I've now converted the repo to Mercurial (using hgext.git
extension), I don't know what to do. Is there an equivalent process (I need those 2 Git modules in my Mercurial repo)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Mercurial 支持不同类型的子存储库:Mercurial、Subversion 和 Git。因此,您可以使用 和 创建一个 .hgsub 文件
,该文件将在克隆 Mercurial 存储库时通知 Mercurial 克隆您的 Git 存储库。您第一次需要自己制作 Git 克隆,或者从磁盘上的其他位置复制它们:
然后您会注意到 Mercurial 已将
.hgsubstate
文件添加到您的存储库,其中存储有关Git 子存储库。需要此文件,以便当您创建新的 Mercurial 克隆时,Mercurial 知道要从子存储库中签出哪个版本。我的一位同事编写了一个子存储库指南,您可能会觉得有用。
Mercurial supports subrepositories of different kinds: Mercurial, Subversion, and Git. So you can create a
.hgsub
file withand that will inform Mercurial to make a clone of your Git repositories when the Mercurial repository is cloned. You need to make the Git clones yourself the first time, or copy them from somewhere else on your disk:
You will then note that Mercurial has added a
.hgsubstate
file to your repository where it stores information about the Git subrepositories. This file is needed so that Mercurial knows which revision to checkout from your subrepositories when you make a new Mercurial clone.A colleague of mine has written a subrepository guide that you might find useful.