Python-Gitlab Unotect Master
在创建项目并将用户添加为开发人员之后,我们一直在使用Python-GitLab的先前版本中,我们一直在使用:
# Unprotect master
branch = project.branches.get('master')
branch.unprotect()
我们希望允许开发人员访问主人。
版本3.2.0中不再可用,任何人都可以指导我如何使用新版本来实现相同的结果,
谢谢
In the previous version of Python-GitLab after creating the project and adding a user as a developer, we have been using:
# Unprotect master
branch = project.branches.get('master')
branch.unprotect()
as we wish to allow developer access to the master.
unprotect is no longer available in version 3.2.0 can anyone guide me on how to achieve the same result using the new version
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要使用“ nofollow noreferrer”>受保护的分支a href =“ https://python-gitlab.readthedocs.io/en/stable/gl_objects/protection_branches.html” rel =“ nofollow noreferrer”> python-gitlab docs )
注意:在这种情况下,
delete()
方法只需取消保护,它不会删除分支。要重新保护它,您可以再次创建它。您还可以直接控制访问级别:
You need to use the Protected Branches API (python-gitlab docs) for this.
Note: the
delete()
method in this case simply unprotects it, it does not delete the branch.To re-protect it, you can then create it again. You can also control access levels directly: