简体   繁体   English

BitBucket SSH 克隆 Git

[英]BitBucket SSH Cloning Git

Following BitBucket docs: https://confluence.atlassian.com/bitbucket/clone-a-repository-223217891.html遵循 BitBucket 文档: https ://confluence.atlassian.com/bitbucket/clone-a-repository-223217891.html

This is the example code snippet of cloning using git.这是使用 git 克隆的示例代码片段。 But when using the ":" I get an error of "could not resolve hostname" but when I use "/" I don't have any issues.但是当使用“:”时,我收到“无法解析主机名”的错误,但是当我使用“/”时,我没有任何问题。 What am I missing?我错过了什么? Is the documentation incorrect?文档不正确吗?


$ git clone ssh://git@bitbucket.org:teamsinspace/documentation-tests.git
$ git clone ssh://git@bitbucket.org/teamsinspace/documentation-tests.git

There are two different syntaxes for git SSH URLs: git SSH URL 有两种不同的语法:

ssh://git@bitbucket.org/teamsinspace/documentation-tests.git

and

git@bitbucket.org:teamsinspace/documentation-tests.git

See https://git-scm.com/docs/git-pull#_git_urls_a_id_urls_ahttps://git-scm.com/docs/git-pull#_git_urls_a_id_urls_a

The Bitbucket docs mixed these two. Bitbucket 文档混合了这两者。 This is an error in the docs.这是文档中的错误。

Note that every Bitbucket repo has a "Clone" button at the top right of the repo's home page.请注意,每个 Bitbucket 存储库在存储库主页的右上角都有一个“克隆”按钮。 You can copy the correct git clone command from there.您可以从那里复制正确的git clone命令。

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

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