1
Xbluer 2018-05-24 19:50:58 +08:00 via iPhone
服务器端控制啊,gitlab 使用分支保护功能。
|
2
elgae 2018-05-24 19:55:53 +08:00 via Android
gerrit
|
3
earther01 OP @Xbluer gitlab 的分支保护功能好像没办法禁止 push -f 而开放普通 push,有什么特别的配置方法么
|
4
azh7138m 2018-05-24 20:16:50 +08:00 via Android 1
直接搜
gitlab disable force push 就有,写个 hook 就行 https://stackoverflow.com/questions/45374801/is-it-possible-in-gitlab-to-disable-force-push-for-all-branches-but-allow-to-de |
5
CFO 2018-05-24 20:42:13 +08:00 via Android
做分支保护 必须发起 pull request 才能合并
|
7
msg7086 2018-05-25 00:12:08 +08:00
@earther01
By default, protected branches are designed to: prevent their creation, if not already created, from everybody except Masters prevent pushes from everybody except Masters -> prevent anyone from force pushing to the branch -> prevent anyone from deleting the branch 把分支加入保护就可以了。 你说的开放普通 Push,就是把 Push 权限下放给 Developers。 如果要禁止普通 Push,把 Push 权限改成 Masters 就行了。 PS: force push 操作记录上是可以查出来的,某某人删除了多少个提交。 |
8
ShadowStar 2018-05-25 00:39:55 +08:00
在远程仓库配置 config:receive.denyNonFastForwards = true
|