简体   繁体   English

有没有一种方法可以将Mercurial存储库用作Git子模块? (更新)

[英]Is there a way to use a Mercurial repository as Git submodule? (update)

I would like to use a mercurial subrepo as as git submodule. 我想将一个水银子仓库用作git子模块。 I have followed the instruction posted to the exact same question here 1 . 我已经按照此处1的相同问题发布的说明进行了操作。 However even though all the setup steps completed successfully and without error when cloning the main repository and its subrepos I am running into errors. 但是,即使在克隆主存储库及其子存储库时所有设置步骤均成功完成且没有错误,但我还是遇到了错误。

Additionally the question at 1 is 5 years old and I am afraid git has changed a lot in that time and therefore I feel this question merits an answer 另外,问题在1岁时已经5岁了,我担心git在那段时间里发生了很大变化,因此我觉得这个问题值得回答

When I clone I run the following: 克隆时,运行以下命令:

git clone --recursive git clone-递归

I get the following error: 我收到以下错误:

Cloning into '/home/user/projects/mainrepo/project/hgsubrepo'... repository does not exist. 克隆到“ / home / user / projects / mainrepo / project / hgsubrepo” ...存储库不存在。 fatal: Could not read from remote repository. 致命:无法从远程存储库读取。

Please make sure you have the correct access rights and the repository exists. 请确保您具有正确的访问权限,并且存储库存在。

fatal: clone of 'git@bitbucket.org:mischief/ippan2.git/project/hgsubrepo' into submodule path '/home/user/projects/mainrepo/project/hgsubrepo' failed Failed to clone 'project/hgsubrepo'. 致命:将“ git@bitbucket.org:mischief / ippan2.git / project / hgsubrepo”克隆到子模块路径“ / home / user / projects / mainrepo / project / hgsubrepo”失败无法克隆“ project / hgsubrepo”。 Retry scheduled Cloning into '/home/user/projects/mainrepo/project/hgsubrepo'... repository does not exist. 重试计划的克隆到'/ home / user / projects / mainrepo / project / hgsubrepo'...存储库不存在。 fatal: Could not read from remote repository. 致命:无法从远程存储库读取。

If I interpret the results correctly git is trying to infer an remote URL for hgsubrepo but using git protocol not mercurial as I would expect given my understanding of the reponse in 1 如果我解释结果正确Git是试图推断的远程URL hgsubrepo但使用git协议不mercurial如我希望给我的效应初探的理解1

Is there a different/better/new way to handle mercurial subrepos within git? 有没有其他/更好/新的方式来处理git中的水银子仓库?

edit 1: the main repository lives in the local folder 编辑1:主存储库位于本地文件夹中

/home/user/projects/mainrepo / home / user / projects / mainrepo

the hg repository lives in 汞储存库位于

/home/user/project/mainrepo/projects/ / home / user / project / mainrepo / projects /

Try git-remote-hg ; 尝试git-remote-hg ; add 'hg::' prefix to the URL of mercurial repository. 在商品库的网址前添加“ hg ::”前缀。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM