gitlab保护分支设置

版本:gitlab10.2.2
一旦设置master分支被保护,除了管理员之外的任何用户都无法直接向master提交代码,只要提交代码就会报错

复制代码
# git push -u origin master
Total 0 (delta 0), reused 0 (delta 0)
remote: GitLab: You are not allowed to push code to protected branches on this project.
To git@192.168.1.12:develpment/myproject-test.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@192.168.1.12:develpment/myproject-test.git'

(1) 点击你的项目

(2) 点击【版本库】------【分支】

(3) 管理受保护的分支

(4) 点击展开

(5) 选择保护master分支

(6) 可以看到master分支已经被保护起来了

相关推荐
7177773 天前
Git自建用什么工具比较好:Gitea、Forgejo、GitLab CE与Gitee的选型对比
git·gitlab·gitea
colinu5 天前
Create gitlab-runner
gitlab
master3366 天前
GitLab 10.x → 19.5.x 升级路线图
gitlab
长不大的杨瑞杰6 天前
OpenCode v2 GitLab 集成实战:Issue 驱动开发、MR 审查与 CI/CD 最小权限
人工智能·ci/cd·gitlab·ai编程·opencode
极小狐12 天前
极狐GitLab万人并发架构实践,大规模组织的扩容路线图
架构·gitlab·极狐gitlab
Lvan的前端笔记13 天前
GitLab CI 环境变量整理
ci/cd·gitlab
李迟13 天前
CICD实例:解决GitLab Runner无法执行CICD问题
gitlab
hanjq_code15 天前
gitlab本地文件 跨分支 忽略改动 不提交
gitlab
极小狐15 天前
极狐GitLab集群高可用方案,多节点架构与故障自愈实践
架构·gitlab·高可用·极狐gitlab
极小狐16 天前
极狐GitLab主备同步延迟治理,复制滞后监控与优化方法
gitlab·极狐gitlab·geo容灾