我怎样才能防止非快速推送到Git中的选定分支? [英] How can I prevent non-fastforward pushes to selected branch(es) in git?

查看:138
本文介绍了我怎样才能防止非快速推送到Git中的选定分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想保护我的git存储库,这样只有非主分支可以被覆盖。有没有办法保护只有选定的分支? .comrel =nofollow> GitEnterprise 来设置每个分支的权限(admin)以阻止使用细粒度访问权限的非快速推送。



git config --system receive.denyNonFastForwards true 只需完成这项工作,如果您需要阻止所有分支的历史记录更改。


I would like to protect my git repository so only non master branches can be overwritten. Is there a way to protect only selected branches?

解决方案

You can use GitEnterprise to setup per-branch permissions (admin) to block non-fastforward pushes using fine-grained access permission.

And git config --system receive.denyNonFastForwards true will simply do the job if you need to block history changing for all branches.

这篇关于我怎样才能防止非快速推送到Git中的选定分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆