我可以从BitBucket中克隆一个git存储库吗?

Mag*_*der 8 git mercurial bitbucket

我正在尝试使用BitBucket git存储库,但我个人更喜欢使用hg.

这有效:

git clone https://myuser@bitbucket.org/projectuser/project.git

它提示我输入密码,然后按预期克隆存储库.

但是,hg不起作用:

hg clone https://myuser@bitbucket.org/projectuser/project.git

这给了我404错误.

我确实安装了hggit扩展.如果我首先使用git在本地克隆,那么我可以将git存储库克隆到hg存储库就好了 - 克隆我的本地驱动器 - 并且可能我可以从本地hg存储库推回到本地git存储库.

我更喜欢直接使用hg中的bitbucket git存储库来/推送.有没有办法做到这一点?

Laz*_*ger 4

对于 Mercurial 和 Git 存储库可以共享的访问协议(http/s/ + ssh),为了唯一标识远程端的类型,使用了特殊类型的协议 -git+real-protocol://

GiHub 上的 SSH-repo 示例(我只是手里没有 https-URL)

>hg clone git+ssh://git@github.com/lazybadger/Fiver-l10n.git
destination directory: Fiver-l10n
importing git objects into hg
updating to branch default
19 files updated, 0 files merged, 0 files removed, 0 files unresolved
Run Code Online (Sandbox Code Playgroud)

与纯 SSH-URL 相比

>hg clone ssh://git@github.com/lazybadger/Fiver-l10n.git Fiver-SSH
remote: Invalid command: 'hg -R lazybadger/Fiver-l10n.git serve --stdio'
remote:   You appear to be using ssh to clone a git:// URL.
remote:   Make sure your core.gitProxy config option and the
remote:   GIT_PROXY_COMMAND environment variable are NOT set.
abort: no suitable response from remote hg!
Run Code Online (Sandbox Code Playgroud)

  • 啊,谢谢,我需要在前面添加 `git+` (显然还要从 BitBucket 前面删除 myuser@ )。 (3认同)