GIT命令-切换分支

  • GIT命令-切换分支已关闭评论
  • 264 views
  • A+
所属分类:Linux
#查看远程分支
git branch -a
* master
 remotes/origin/HEAD -> origin/master
 remotes/origin/master
 remotes/origin/v0.9rc1
#查看本地分支
git branch
* master

#切换到远程的v0.9rc1分支
git checkout -b v0.9rc1 origin/v0.9rc1
Branch master set up to track remote branch master from origin.
Switched to a new branch 'master'

#已经切换到v0.9rc1分支了
$ git branch
  master
* v0.9rc1

#切换回master分支
$ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.

 

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin