2016-06-08 126 views
-1

當我git branch我只看到'主','V2 /分支1'和'V2 /主',但當我git branch -r我看到更多的分支來源後。如果我想要在這些遠程分支中工作,那麼我只需要簽帳?這會自動改變我的工作目錄和索引到該分支,併爲我設置跟蹤分支?如何結帳遠程分支?

+6

[結帳遠程GIT中分支(的可能的複製http://stackoverflow.com/questions/1783405/checkout-remote -git-branch) – Vitor

回答

0

git fetch remote

git checkout --track -b local_branch_name origin/branch_name

+0

你能解釋抓取的目的嗎?不是我的git分支-r意味着我已經在跟蹤所有這些遠程分支? – akantoword

0

按照下面的步驟進行:

git branch -r 
git checkout <branch name>