如何克隆 bitbucket 存储库?

How to clone a bitbucket repository?

一段时间后重新开始工作,我似乎不知道如何克隆 bitbucket 存储库。知道为什么我会收到 "not found" 错误吗?

git clone --verbose https://bitbucket.org/helllamer/mod_openid
Cloning into 'mod_openid'...
remote: Not Found
fatal: repository 'https://bitbucket.org/helllamer/mod_openid/' not found

系统:

git version 1.9.1
uname -a Linux openvpnas2 3.13.0-44-generic #73-Ubuntu SMP Tue Dec 16 00:22:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

很可能它是一个私人存储库,您有访问权限而我没有。您需要做的是将鼠标移到顶部左侧窗格的三个点上(请参阅图像),然后您会看到一个弹出窗口,您可以在其中找到克隆选项。单击它,您将获得类似 hg clone bitbucket-url 的命令(正如 Chris 提到的,这是一个 Mercurial 存储库)。复制并将其粘贴到您的终端上。如果您有权访问存储库,您将能够克隆它。

这是一个Mercurial repository, not a Git repository. Bitbucket supports both systems

克隆:

hg clone https://bitbucket.org/helllamer/mod_openid

有关 Mercurial 的更多信息,请参阅 its Wikipedia page

以下适用于 Mercurial 存储库。

hg clone https://[YourUserName]@bitbucket.org/tr_radlab/radlab-for-windows/branch/default

将上面的 [YourUserName] 替换为您的用户名 Url。

和GitHub一样简单。 从浏览器转到 Bitbucket 存储库并复制 url。 在想要克隆存储库的所需位置打开终端,然后键入:

git clone <copied url of repo.>

然后它会询问您的 Bitbucket 用户名和密码。提供后,您可以克隆它。

在 bitbucket 屏幕的左侧有一个带有按钮的垂直列。从顶部数第二个按钮是 "CLONE" button 。 按下此按钮。您将获得 HTTP 地址。

复制此地址并以常规方式在 git 中使用:

git clone <HTTP address of repo>

如果你不是 cmd 类型,你最好只需要简单地下载,这样你就可以使用 sourcetree 或使用 Mercurial 享受克隆。