git 创建本地分支并提交到远程

记忆力不行了,这个功能已经用过多次,都不能靠记忆力顺利操作

很有必要记录一笔啊

        
        创建分支(git branch v1.0.3 ;  $ git checkout v1.0.3)
        $ git checkout -b v1.0.3

$ git branch    //查看当前所有分支,星号表示当前
  master
  v1.0.1
  v1.0.2
* v1.0.3

$ git commit -m '重构项目结构,分包'
[v1.0.3 ad4e082] 重构项目结构,分包
 5 files changed, 2264 insertions(+), 2206 deletions(-)


$ git merge dev
git merge命令用于合并指定分支到当前分支


$ git push origin v1.0.3:v1.0.3


$ git push
fatal: The current branch v1.0.3 has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin v1.0.3

git 创建本地分支并提交到远程_第1张图片

 

你可能感兴趣的:(git,git,github)