GIT命令-切换分支

2,309次阅读
没有评论

# 查看远程分支
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'.

 

正文完
 
Blood.Cold
版权声明:本站原创文章,由 Blood.Cold 2017-11-22发表,共计393字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。