命令
1、查看远程所有分支 git branch -r
PS C:\Users\Lenovo\Desktop\tt\dc-biztable> git branch -r
origin/Develop
origin/master
origin/dev
2、拉取远程分支到本地 git fetch origin 远程分支名:本地分支名
这个远程分支名和本地分支名可以不一样, 不过一般都会取一样的名字这样不容易混淆
PS C:\Users\Lenovo\Desktop\tt\dc-biztable> git fetch origin Develop:Develop
From http://192.168.10.19:7901/sjzx/tbbs/dc-biztable
* [new branch] Develop -> Develop
PS C:\Users\Lenovo\Desktop\tt\dc-biztable> git branch
* master
Develop
3、拉取远程分支到本地同时切换到刚刚拉取的分支
git checkout -b 本地分支名 origin/远程分支名
PS C:\Users\Lenovo\Desktop\tt\dc-biztable> git checkout -b dev origin/dev
Switched to a new branch 'dev'
Branch 'dev' set up to track remote branch 'dev' from 'origin'.
PS C:\Users\Lenovo\Desktop\tt\dc-biztable> git branch
master
Develop
* dev
|