git创建分支并推送到远程分支上

1.创建分支QtForAndroidV2.0
ScottChen@ScottChen-PC MINGW64 /e/git/QtForAndroid (developer)
$ git branch QtForAndroidV2.0

2.查看创建的分支
ScottChen@ScottChen-PC MINGW64 /e/git/QtForAndroid (developer)
$ git branch -a
  QtForAndroidV2.0
* developer
  master
  remotes/origin/developer
  remotes/origin/master
  
3.把developer分支合并到新建的分支QtForAndroidV2.0上
ScottChen@ScottChen-PC MINGW64 /e/git/QtForAndroid (developer)
$ git merge QtForAndroidV2.0
Already up to date.

4.切换到QtForAndroidV2.0分支
ScottChen@ScottChen-PC MINGW64 /e/git/QtForAndroid (developer)
$ git checkout QtForAndroidV2.0
Switched to branch 'QtForAndroidV2.0'

//5.推送到远程分支QtForAndroidV2.0上
//ScottChen@ScottChen-PC MINGW64 /e/git/QtForAndroid (QtForAndroidV2.0)
//$ git push
//fatal: The current branch QtForAndroidV2.0 has no upstream branch.
//To push the current branch and set the remote as upstream, use
//
//    git push --set-upstream origin QtForAndroidV2.0

5.推送到远程分支QtForAndroidV2.0上
ScottChen@ScottChen-PC MINGW64 /e/git/QtForAndroid (QtForAndroidV2.0)
$ git push origin QtForAndroidV2.0
Total 0 (delta 0), reused 0 (delta 0)
remote:
remote: To create a merge request for QtForAndroidV2.0, visit:
...........................
 * [new branch]      QtForAndroidV2.0 -> QtForAndroidV2.0

ScottChen@ScottChen-PC MINGW64 /e/git/QtForAndroid (QtForAndroidV2.0)
$ git checkout developer
Switched to branch 'developer'
Your branch is up to date with 'origin/developer'.

6.切回原来的developer开发分支
ScottChen@ScottChen-PC MINGW64 /e/git/QtForAndroid (developer)
$

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值