how to pull remote branch in source tree

折月煮酒 提交于 2020-01-14 07:21:09

问题


I have repo in bitbucket. it has 2 branches master and Branch9_Artiflex but when I clone this repo to my local repo via source tree (clone-clone in source tree) i'm able to see only master branch.

Create new branch Branch9_Artiflex on my local machine and pull all data from remote Branch9_Artiflex doesn't work because they have differnet history of commits

source tree

but my remote repo has 2 branches


回答1:


Try

  • git fetch . This would fetch any missed remote branch to local repository (assuming there's no other problem).
  • git checkout Branch9_Artiflex. Now you will be switched into a local/Branch9_Artiflex which is newly created with the latest changes of origin/Branch9_Artiflex. :))



回答2:


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):



来源:https://stackoverflow.com/questions/42073591/how-to-pull-remote-branch-in-source-tree

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!