Git合并分支后,需要将子分支提交到git仓库,这个时候就需要单独提交子分支,其步骤如下:
1.先创建子分支,并包含最新当前分支下的修改数据
?| 1 |
git checkout -b sonBranch
|
2.将新分支内容全部提交
?| 1 2 |
git add .
git commit -m "完成开发"
|
3.在码云创建一个子分支
?| 1 |
git push -u origin sonBranch
|
4.切换到主分支
?| 1 |
git checkout master
|
5.合并分支,更新主分支内容
?| 1 |
git merge sonBranch
|
6.重新提交主分支内容
?| 1 |
git push
|
PS:下面看下gitee 如何创建仓库 及发布
http://pengchenggang.gitee.io/layuisyshelp
-----------
在本地项目文件中使用bash
?| 1 2 3 |
$ git config --global user.name "你的名字"
$ git config --global user.email "你的邮箱"
|
1. 初始化
?| 1 2 |
$ git init
$ git remote add origin https://gitee.com/xxx/xxx.git (你的远程项目地址)
|
2.克隆一下
?| 1 |
$ git clone https://****.git (你的远程项目地址)
|
3. 提交
?| 1 2 3 4 5 6 7 8 |
$ git pull origin master
$ git add .
$ git commit -m "你的第一次提交"
$ git push origin master
---------------------
|
gitee 里面要发布一个pages的服务,然后就能访问了
总结
到此这篇关于Git创建子分支,合并分支并提交的文章就介绍到这了,更多相关Git创建子分支内容请搜索服务器之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持服务器之家!
原文链接:https://www.cnblogs.com/cqkjxxxx/p/12791313.html








发表评论
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。