使用bitbucket repo git submodule add失败了

时间:2015-03-21 20:17:40

标签: git mercurial bitbucket git-submodules

我试图为我的项目添加一个repo作为子模块,因为它依赖于它。该项目托管在bitbucket上,当我尝试使用它添加它时:git submodule add https://bitbucket.org/blueluna/transmissionrpc,我得到了以下内容:

Cloning into 'transmissionrpc'...
fatal: repository 'https://bitbucket.org/blueluna/transmissionrpc/' not found
Clone of 'https://bitbucket.org/blueluna/transmissionrpc' into submodule path 'transmissionrpc' failed

我点击了终端中的链接本身,这导致了一个有效的链接。我不知道如何在我的github repo中添加它。它还将通过SSH和HTTPS中的git clone提供问题。注意,复制用于克隆此repo的原始命令如下:hg clone ssh://hg@bitbucket.org/blueluna/transmissionrpc,据我所知使用mercurial。

1 个答案:

答案 0 :(得分:3)

由于它是一个多变的回购,错误是预期的:git无法将其克隆为(git)子模块回购。

你需要一个git repo才能将你的repo添加为(git)子模块。
这将涉及转换,如" Is there a way to use a Mercurial repository as Git submodule?"。

中所述

OP cellsheet报告转化部分因repo.branchtags() unavailable in Mercurial 2.9 而失败,但可以使用以下补丁修复hg-fast-export.py

270a271,287

> def legacy_branchtip(repo, heads):
>     '''return the tipmost branch head in heads'''
>     tip = heads[-1]
>     for h in reversed(heads):
>         if not repo[h].closesbranch():
>             tip = h
>             break
>     return tip
> 
> def legacy_branchtags(repo):
>     '''return a dict where branch names map to the tipmost head of
>     the branch, open heads come before closed'''
>     bt = {}
>     for bn, heads in repo.branchmap().iteritems():
>         bt[bn] = legacy_branchtip(repo, heads)
>     return bt
> 
272c289
<   branches=repo.branchtags()
---
>   branches=legacy_branchtags(repo)
> 

块引用