Gitlab分支保护

 

问题:使用Git时,会碰到须要对某个分支进行保护,避免其余人随意push。git

 

这里以gitlab为例,具体操做以下:gitlab

1.进入项目blog

2.点击左侧列表中的Settingsit

3.点击Protected Branchesast

4.进入后可发现,当前默认master分支为受保护,即只能master角色能够pushim

5.以develop分支为例进行保护developer

如上图区域1中,在Branch中选择分支develop,点击Protect,若是须要developer角色能够push,则勾选“Developer can push”,点击Protect以后,便可添加成功项目

6.几个操做说明,上图区域2img

①默认master分支受保护,且只有master角色能够pushco

②已经添加好受保护的分支,也有Developers can push选项   表示:角色developer能够push当前项目

③Unprotect 表示:不保护当前分支。点击以后,当前分支再也不受保护,developer和master都可push

相关文章
相关标签/搜索