我可以从BitBucket克隆一个git仓库吗? [英] Can I hg clone a git repository from BitBucket?

查看:873
本文介绍了我可以从BitBucket克隆一个git仓库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用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存储库中拉/推。有没有办法做到这一点?

解决方案

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



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

 > hg clone git + ssh://git@github.com/lazybadger/Fiver-l10n.git 
目的地目录:Fiver-l10n
将git对象导入hg
更新到分支默认
19个文件更新,0个文件合并,0个文件删除,0个文件未解决

-URL

 > hg clone ssh://git@github.com/lazybadger/Fiver-l10n.git Fiver-SSH 
remote:无效命令:'hg -R lazybadger / Fiver-l10n.git serve --stdio'
remote:您似乎在使用ssh克隆git:// URL。
remote:确保您的core.gitProxy配置选项和
remote:GIT_PROXY_COMMAND环境变量未设置。
中止:远程hg没有合适的响应!


I am trying to use a BitBucket git repository, but I personally prefer using hg.

This works:

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

It prompts me for a password, then clones the repository as expected.

However, hg does not work:

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

This gives me a 404 error.

I do have the hggit extension installed. If I first clone locally with git, I can then clone the git repository to an hg repository just fine - cloning off my local drive - and presumably I could push back from to the local hg repository to the local git repository.

I'd just prefer to pull/push directly with the bitbucket git repository from hg. Is there a way to do this?

解决方案

For access-protocols, which Mercurial's and Git's repositories can share (http/s/ + ssh), in order to uniquely identify remote side's type, special type of protocol used - git+real-protocol://

Sample for SSH-repo on GiHub (I just haven't https-URL in hands)

>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

compared to pure 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!

这篇关于我可以从BitBucket克隆一个git仓库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆