Git命令之分支操作
Posted JeemyJohn
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Git命令之分支操作相关的知识,希望对你有一定的参考价值。
1. 查看全部分支
$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/origin/jeemy
2. 查看本地分支
$ git branch
* master
3. 切换分支
- 切换到 jeemy 分支
$ git checkout -b jeemy origin/jeemy
Branch jeemy set up to track remote branch jeemy from origin.
Switched to a new branch 'jeemy'
# 查看当前分支
$ git branch
master
* jeemy
# 切换回master分支
$ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
4. 删除分支
1、删除本地分支(假设分支名为:jeemy-test)
$ git branch -d jeemy-test
Deleted branch jeemy-test (was 5adae21).
2、 删除远程分支
$ git push origin :jeemy-new
To https://git.wemomo.com/recommend/recommend-streaming-jobs.git
- [deleted] jeemy-new
以上是关于Git命令之分支操作的主要内容,如果未能解决你的问题,请参考以下文章