如何克隆bitbucket中的特定分支

时间:2014-10-29 00:22:25

标签: ruby-on-rails-3 git ruby-on-rails-4 github bitbucket-api

我有一个托管在bitbucket中的远程存储库,但是当我想将此存储库克隆到我的电脑时 Bitbucket克隆主分支 我想在同一个远程项目中克隆另一个名为static_pages_exercises的分支。这可能。

Error:it clones the remote master branch no the remote static-pages-exercises branch


daniel:~/workspace$ mkdir sample_app
daniel:~/workspace$ git init .
Reinitialized existing Git repository in /home/fernando/workspace/.git/
fernando@fernando:~/workspace$ git clone git@bitbucket.org:ferbad1212/sample_app.git
Cloning into 'sample_app'...
remote: Counting objects: 139, done.
remote: Compressing objects: 100% (124/124), done.
remote: Total 139 (delta 42), reused 0 (delta 0)
Receiving objects: 100% (139/139), 23.05 KiB, done.
Resolving deltas: 100% (42/42), done

1 个答案:

答案 0 :(得分:0)

尝试以下命令

git clone --branch branchname cloneUrl

例如

git clone --branch feature https://cloneurl