BitBucket SSH克隆Git

BitBucket SSH克隆Git

问题描述:

以下BitBucket文档: https://confluence.atlassian.com/bitbucket/clone-a-repository-223217891.html

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

这是使用git进行克隆的示例代码片段.但是当使用:" 时,出现错误无法解析主机名",但是当我使用"/" 时,我没有任何问题.我想念什么?文档不正确吗?

This is the example code snippet of cloning using 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

git SSH URL有两种不同的语法:

There are two different syntaxes for git SSH URLs:

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

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

请参见 https://git-scm.com/docs/git-pull# _git_urls_a_id_urls_a

Bitbucket文档将这两者混合在一起.这是文档中的错误.

The Bitbucket docs mixed these two. This is an error in the docs.