如何在源树中拉远程分支

ket*_*hyn 9 git bitbucket sourcetree

我在bitbucket有回购.它有2个分支master和Branch9_Artiflex但是当我通过源代码树(源树中的克隆克隆)将这个repo克隆到我的本地repo时,我只能看到master分支.

在我的本地计算机上创建新分支Branch9_Artiflex并从远程Branch9_Artiflex中提取所有数据不起作用,因为它们具有不同的提交历史记录

源树 在此输入图像描述

但我的远程仓库有2个分支机构 在此输入图像描述

Sup*_*hne 9

尝试

  • git fetch.这会将任何错过的远程分支提取到本地存储库(假设没有其他问题).
  • git checkout Branch9_Artiflex.现在,您将切换到本地/ Branch9_Artiflex,它是使用origin/Branch9_Artiflex的最新更改新创建的.:))

  • 我也无法看到所有分支,但在阅读上面的评论后,我进行了搜索,这个答案 /sf/answers/1815931281/ 为我解决了这个问题 (2认同)

Dan*_*iel 5

You can do this with the git cli as well as directly in SourceTree UI. Expanding REMOTES > origin was very close: You need to double click on the remote branch there, in your case _Branch9_Artiflex_. Then the following popup appear:

在此处输入图片说明

This would clone the remote branch staging to a local branch with the same name. Click OK, then SourceTree will fetch the RemoteBranch and it appears on your local branches tree (sidebar left):

在此处输入图片说明