阻止git force推送所有分支

时间:2018-05-03 07:20:52

标签: git scmmanager

我正在使用SCM-Manager(GIT)。

我希望在名为" git_playground"的存储库中阻止强制推送选项。对于远程的所有分支

我不确定在git服务器中设置以下配置的位置

receive.denyNonFastForwards true

我试图将上述内容设置为 [core]下的存储库配置文件为

receive.denyNonFastForwards =  true

在此之后我无法克隆该存储库。 所以撤销了它。

2 个答案:

答案 0 :(得分:1)

不是[core]

[receive]
denyNonFastForwards = true

要避免此类问题,请使用命令行编辑配置:

git config receive.denyNonFastForwards true

答案 1 :(得分:1)

您还可以在 Config->存储库类型 - > Git 中使用SCM-Manager配置选项禁止非快进(自版本1.55起可用)。如果启用此选项,SCM-Manager将阻止每次强制推送。但是此选项是全局的,会影响SCM-Manager实例上的每个存储库。

相关问题