git命令查看、创建、切换、删除分支

1. 查看本地、远程分支(前面带*号的代表你当前工作目录所处的分支)
$ git branch -a
* develop
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/develop
  remotes/origin/master
2. 查看本地分支
$ git branch
* develop
  master
3. 创建分支
$ git branch test
$ git branch
* develop
  master
  test
4. 切换分支到test
$ git checkout develop
Switched to branch 'develop'
5. 删除本地分支
$ git br -d test
  Deleted branch test (was 17d28d9).  

您可以选择一种方式赞助本站

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: