今天快要被这个问题搞死了,只要加上--force 就能强制覆盖远程仓库,导致别人的提交消失的无影无踪,从提交记录上还很难查到是谁进行了强制覆盖。
大佬们,有没有什么办法能禁止强制提交呢?
大佬们,有没有什么办法能禁止强制提交呢?
1
Xbluer May 24, 2018 via iPhone
服务器端控制啊,gitlab 使用分支保护功能。
|
2
elgae May 24, 2018 via Android
gerrit
|
4
azh7138m May 24, 2018 via Android 直接搜
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 May 24, 2018 via Android
做分支保护 必须发起 pull request 才能合并
|
7
msg7086 May 25, 2018
@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 May 25, 2018
在远程仓库配置 config:receive.denyNonFastForwards = true
|