|
In the previous version of Python-GitLab after creating the project and adding a user as a developer, we have been using: 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 |
Answered by
nejch
Apr 28, 2022
Replies: 1 comment 1 reply
|
I believe I just answered this on stackoverflow but copy/pasting for posterity. (https://stackoverflow.com/questions/72038367/python-gitlab-unprotect-master) You need to use the Protected Branches API (python-gitlab docs) for this. Note: the To re-protect it, you can then create it again. You can also control access levels directly: |
1 reply
Answer selected by
nejch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I believe I just answered this on stackoverflow but copy/pasting for posterity. (https://stackoverflow.com/questions/72038367/python-gitlab-unprotect-master)
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: