gitlab 合并分支到master分支
一、新建一个gitlab仓库后
You can also upload existing files from your computer using the instructions below.
推送代码结束
二、新增分支要的合并代码
1、clone主分支代码
git -c http.sslVerify=false clone git@192.168.40.132:root/ops.git
(http.sslVerify=false禁用Git SSL验证)
2、切换到一个新分支 'release-1.0'
git checkout -b release-1.0
3、修改代码
vi test.py
4、推送到代码仓库
git add . #(本地提交更新) git commit -m "release-1.0" #(将代码远程推送到 release-1.0分支当中) [release-1.0 f23169b] release-1.0 2 files changed, 3 insertions(+), 6 deletions(-) create mode 100644 test.py git -c http.sslVerify=false push origin release-1.0 remote: remote: INFO: Your SSH key is expiring soon. Please generate a new key. remote: Counting objects: 12, done. Delta compression using up to 2 threads. Compressing objects: 100% (6/6), done. Writing objects: 100% (7/7), 578 bytes | 0 bytes/s, done. Total 7 (delta 4), reused 0 (delta 0) remote: remote: To create a merge request for release-1.0, visit: remote: http://192.168.40.132:9090/root/ops/-/merge_requests/new?merge_request%5Bsource_branch%5D=release-1.0 remote: To git@192.168.40.132:root/ops.git * [new branch] release-1.0 -> release-1.0
5、将release-1.0分支的代码合并到master分支
点击“Create merge requests”
或者
6、创建一个合并请求,选择源分支和目标分支
7、添加描述,指明谁来review操作合并这项工作
8、操作账号查看merge请求
9、查看与目标分支的差异变化
10、点击Merge即同意合并请求
11、查看合并效果,'release-1.0‘分支被合并,master分支代码发生改变
暂存问题:
当其他账号提交的merge请求不满足代码规范要求时,可以不用打回,直接修改吗?然后合并