git 从本地分支创建一个新分支。并把新分支推送到线上

git 从本地分支创建一个新分支。并把新分支推送到线上

eg.

本地master分支无法直接推送到线上,但是已经改了很多文件了。

解决方案:

从本地master分支创建新分支features/3.0.0 ,

然后推送到线上。

这样本地已经更改的文件,也会在新分支features/3.0.0 中了。

git checkout -b features/3.0.0

git push origin features/3.0.0

 
$ git checkout -b iss53
Switched to a new branch "iss53"
它是下面两条命令的简写:
 
$ git branch iss53
$ git checkout iss53
 
原文地址:https://www.cnblogs.com/wangdongjie0101/p/14516556.html