从git拉特定的分支 [英] Pull specific branch from git

查看:117
本文介绍了从git拉特定的分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 bitbucket 中有一个回购,并使用 git



所以我的分支是

$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $

当我使用 git clone git@bitbucket.org:project / project.git ,我得到的只是主分支代码,但我需要克隆/只拉 develop_one 分支,所以如何克隆/只拉 develop_one 分支代码?



注意:其他分支(develop_one,develop_two)未合并到master ,并且不想合并,直到实际完成功能,所以想要获得/克隆/只拉一个特定的分支代码

解决方案

Try:

git clone git@bitbucket.org:project / project.git -b develop_one --single-branch $ b

对于已经克隆好的回购使用:

  git fetch 
git checkout develop_one
#或者更具体的:
git checkout --track -b develop_one

这将跟踪develop_one分支从远程。


I have a repo in bitbucket, and i am using git.

So my branches are

master
develop_one
develop_two

When i use git clone git@bitbucket.org:project/project.git, i am getting only the master branch code, but i need to clone/pull only develop_one branch, so how to clone/pull only develop_one branch code ?

Note: The other branches(develop_one, develop_two) are not merged in to master, and dont want to merge until the functionality has been completed actually, so want to get/clone/pull only a specific branch code

解决方案

Try:

git clone git@bitbucket.org:project/project.git -b develop_one --single-branch

For already cloned repos use:

git fetch
git checkout develop_one
# Or more specific:
git checkout --track -b develop_one

This will track the develop_one branch from the remote.

这篇关于从git拉特定的分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆