文章目录
配置GitLab
帮助文档
GitLab自带的帮助文档:
https://<your_gitlab_domain>/help
比如:
https://gitlab.xdevops.cn/help
GitLab参考文档:
常规配置
创建Group,在Group下创建Project,在Group下添加User
注意:Group和Project不能设置为Public,不然其它用户不需要登陆也可以看到项目的代码。
创建Project
添加User
添加User:
- 限制Project limit(默认为100000)
- 取消勾选Can create group(如果有必要)
- 保持Access level为Regular (对非管理员用户)
添加完该User后,用管理员账号给该User设置密码。
该User第一次登陆时,还会被要求重新设置密码。
在Group中添加Member
Group owner/maintainer可以在Group中添加member
在Project中添加Member
Project owner/maintainer可以在Group中添加member
用户权限
https://docs.gitlab.com/ee/user/permissions.html
简单地说:
- Guest:只读,不能clone代码
- Reporter:只读,能clone和pull代码,不能push代码
- Developer:能clone和pull代码,能push代码到unprotected branch;不能push代码到protected branch,能发起merge request
- Maintainer:能push代码到protected branch,能合并merge request,有管理权限,但是不能删除项目
- Owner:管理员权限
一般地将Guest权限分配给一些公共文档的读者,将Reporter权限分配给CI工具专有账号(比如Jenkins),将Developer权限分配给普通开发人员,将Maintainer权限分配给资深开发人员、主程序员、开发经理和架构师。