git切换远程分支

1.查看分支
ScottChen@ScottChen-PC MINGW64 /e/git/MyProject (master)(当前分支)
$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/MyProject V3.0.0
  remotes/origin/MyProject V4.0
  remotes/origin/MyProject V4.1.0
  remotes/origin/MyProject V4.2.0
  remotes/origin/developer
  remotes/origin/master
 
2.切换分支
ScottChen@ScottChen-PC MINGW64 /e/git/MyProject (master)(当前分支)
$ git checkout -b developer origin/developer
Checking out files: 100% (892/892), done.
Switched to a new branch 'developer'
Branch 'developer' set up to track remote branch 'developer' from 'origin'.
 
3.切换完成查看分支
ScottChen@ScottChen-PC MINGW64 /e/git/MyProject (developer)(当前分支)
$ git branch -a
* developer
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/MyProject V3.0.0
  remotes/origin/MyProject V4.0
  remotes/origin/MyProject V4.1.0
  remotes/origin/MyProject V4.2.0
  remotes/origin/developer

  

posted @ 2020-09-25 12:47  CesareCheung  阅读(281)  评论(0编辑  收藏  举报