git命令——从GitHub clone XXX分支,本地创建新分支push到远程仓库
PS:文章以clone开源项目 junit5-samples 为例
步骤如下
- 从XXX分支clone项目到本地(bom为分支名称)
- git clone -b bom https://github.com/junit-team/junit5-samples.git
- 创建自己的本地新分支
- git brach dev-junit5-test
- 查询远程仓库,把新分支推送到远程仓库
- 查看远程仓库:git remote
- 把新分支推送到远程仓库(此处origin为远程仓库名称):git push origin dev-junit5-test
- 此步骤执行完成,远程仓库会生成分支dev-junit5-test
- 将当前分支代码与远程仓库新分支进行关联
- git branch --set-upstream-to=origin/dev-junit5-test
- 将本地分支代码远程仓库新分支
- git add -A:提交到暂存区
- git commit ‘XXXXXXX‘:提交到本地分支
- git push origin dev-junit5-test:推动到远程仓库
- Next
相关推荐
formula 2020-11-12
huhongfei 2020-11-05
乾坤一碼農 2020-10-27
liumengyanysu 2020-10-22
E哥的aws认证攻略 2020-10-15
guying 2020-10-05
好脑筋不如烂笔头 2020-09-17
baolen 2020-08-15
Equation 2020-08-09
Balmunc 2020-08-02
fenggou 2020-07-18
zhangxing 2020-07-05
loganwz 2020-07-05
tianyafengxin 2020-10-08
nebulali 2020-09-11