git branch(分支命令的使用:http://hbiao68.iteye.com/blog/2055493)
git branch -a 查看所有分支
0.可以通过git branch -r 命令查看远端库的分支情况
1,从已有的分支创建新的分支(如从master分支),创建一个dev分支
git checkout -b dev
2,创建完可以查看一下,分支已经切换到dev
git branch
* dev
master
3.建立本地到上游(远端)仓的链接 --这样代码才能提交上去
git branch --set-upstream-to=origin/dev
取消对master的跟踪
git branch --unset-upstream master
4.提交该分支到远程仓库
git push origin dev
git 创建分支提交远程分支
以下两个应该是同一个意思,=upstream : 上游码流的意思
git branch --set-upstream-to=master
git branch --set-upstream-to=original/master
git help branch
git branch [--set-upstream | --track | --no-track] [-l] [-f] <branchname> [<start-point>]
git branch (--set-upstream-to=<upstream> | -u <upstream>) [<branchname>]
git branch --unset-upstream [<branchname>]
git branch --set-upstream-to=original/master new
git branch --set-upstream debug origin/debug //其中debug为创建的分支
参考:https://my.oschina.net/u/219482/blog/285584
https://blog.csdn.net/ljj_9/article/details/79386306
https://www.cnblogs.com/bluestorm/p/6252900.html