Git 分支操作
查看分支
- 查看本地分支
git branch
- 查看远程分支
git branch -r
- 查看本地和远程分支
git branch -a
创建分支
- 仅创建分支:
git branch <branch-name>
- 创建分支并切换过去:
git checkout -b <branch-name>
移除分支
- 移除本地分支:
git branch -d <local-branchname>
- 移除远程分支:
git push origin --delete <remote-branchname>
切换本地分支
切换到本地已有分支:
git checkout <branch-name>
本地分支与远程分支的追踪关系
git branch -vv
References
走在前沿的弄潮儿,怎能不会Git的那些奇技淫巧 -- 机器之心
Git本地分支与远程分支的追踪关系 -- HyperDai
作者:wuliytTaotao
本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。