Creating branch, but gitlab shows "Branch was deleted" #2534
-
|
I'm creating a python script that will allow us to make projects that are configured with a consistent set of options. Part of the configuration involves adding a protected branch. I'm doing this with the following code. project.protectedbranches.create({'name': 'integrate', After I run the script, I open the project in the web browser and go to 'Settings|Repository|Protected branches'. I see the branch listed in the table at the bottom of the section, but it also says 'Branch was deleted'. I cloned the project and verified the branch does not exist. Is there something I'm missing in my call? python: 3.7.9 Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Does the branch already exist before you mark it as "protected". https://python-gitlab.readthedocs.io/en/main/gl_objects/branches.html Creating a "protected branch" doesn't create a branch. It just defines what will be a protected branch and what the restrictions are on that protected branch. References: |
Beta Was this translation helpful? Give feedback.
Does the branch already exist before you mark it as "protected". https://python-gitlab.readthedocs.io/en/main/gl_objects/branches.html
Creating a "protected branch" doesn't create a branch. It just defines what will be a protected branch and what the restrictions are on that protected branch.
References:
https://docs.gitlab.com/ee/api/protected_branches.html#protected-branches-api