1. gitlab创建组

创建后:

组管理:


组创建完成后,开始创建用户
2. gtilab创建用户


这里无法直接创建密码,需要创建用户后在对用户进行操作修改密码

密码和权限设置,取消和开启创建组权限

通过模拟用户来查看用户权限


模拟权限:

每次模拟完权限后,用户默认就切换到了所模拟的用户,需要退出后重新登录root才好
3. 添加用户到组
创建用户和组后,需要将用户添加到组后,用户才可以对所在组下的项目进行操作.

组权限有5种.下面是这5种权限的区别.期中master,owner最大.
权限介绍:
| 百度来的权限体系 | Guest | Reporter | Developer | Master | Owner |
|---|---|---|---|---|---|
| Create new issues | * | * | * | * | * |
| Leave comments | * | * | * | * | * |
| Pull the project code | * | * | * | * | |
| Download a project | * | * | * | * | |
| Create code snippets | * | * | * | * | |
| Create new merge requests | * | * | * | ||
| Push changes to nonprotected branches | * | * | * | ||
| Remove nonprotected branches | * | * | * | ||
| Add tags | * | * | * | ||
| Write a wiki | * | * | * | ||
| Manage the issue tracker | * | * | * | ||
| Add new team members | * | * | |||
| Push changes to protected branches | * | * | |||
| Manage the branch protection | * | * | |||
| Manage Git tags | * | * | |||
| Edit the project | * | * | |||
| Add deploy keys to the project | * | * | |||
| Configure the project hooks | * | * |
由于是给dev 开发用户,这里选择 Developer 即可

gitlab创建仓库


这里我们创建一个 leilei_test 私有的仓库

如何使用仓库
1. git全局配置
git config --global user.name "Administrator"
git config --global user.email "admin@example.com"
2. 创建一个新的存储库
git clone git@10.0.0.63:root/leilei_test.git
cd leilei_test
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
3. 利用现有文件夹
cd [文件夹]
git init
git remote add origin git@10.0.0.63:root/leilei_test.git
git add .
git commit -m "Initial commit"
git push -u origin master
4.利用已存在的现有仓库
cd existing_repo
git remote rename origin old-origin
git remote add origin git@10.0.0.63:root/leilei_test.git
git push -u origin --all
git push -u origin --tags
5.仓库加入组,让所在组的用户可以管理对应组
模拟查看:

至此, 新建仓库,用户,组,仓库授权给组,组里的用户可以访问组下的仓库.
创建仓库
创建组
创建用户
用户添加到组
组和仓库权限配置
模拟用户登录查看权限.
微信赞赏
支付宝赞赏