【问题标题】:Is there a way to use a Mercurial repository as Git submodule? (update)有没有办法将 Mercurial 存储库用作 Git 子模块? (更新)
【发布时间】:2017-10-30 05:50:06
【问题描述】:

我想使用一个 mercurial 子仓库作为 git 子模块。我已按照此处1 发布到完全相同的问题的说明进行操作。但是,即使在克隆主存储库及其子存储库时所有设置步骤都已成功完成且没有错误,我还是遇到了错误。

另外1 的问题是 5 岁,我担心 git 在那段时间发生了很大变化,因此我觉得这个问题值得回答

当我克隆时,我运行以下命令:

git clone --recursive

我收到以下错误:

克隆到 '/home/user/projects/mainrepo/project/hgsubrepo'... 存储库不存在。致命:无法从远程读取 存储库。

请确保您拥有正确的访问权限和存储库 存在。

致命:克隆 'git@bitbucket.org:mischief/ippan2.git/project/hgsubrepo' 进入子模块路径 '/home/user/projects/mainrepo/project/hgsubrepo' 未能克隆“项目/hgsubrepo”。计划重试 克隆到 '/home/user/projects/mainrepo/project/hgsubrepo'... 存储库不存在。致命:无法从远程读取 存储库。

如果我正确解释结果,git 会尝试推断 hgsubrepo 的远程 URL,但使用 git 协议而不是 mercurial,因为我对 1 中的响应的理解是我所期望的

在 git 中处理 mercurial subrepos 是否有不同/更好/新的方法?

编辑 1: 主存储库位于本地文件夹中

/home/user/projects/mainrepo

hg 存储库位于

/home/user/project/mainrepo/projects/

【问题讨论】:

    标签: git mercurial


    【解决方案1】:

    试试git-remote-hg;在 mercurial 存储库的 URL 中添加 'hg::' 前缀。

    【讨论】:

      猜你喜欢
      • 2012-02-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多