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

posted @ 2019-12-13 21:59  wuliytTaotao  阅读(175)  评论(0)    收藏  举报