简体   繁体   中英

BitBucket SSH Cloning Git

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

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

There are two different syntaxes for git SSH URLs:

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_a

The Bitbucket docs mixed these two. 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. You can copy the correct git clone command from there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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