Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
599 views
in Technique[技术] by (71.8m points)

git - Can not create protected branch in this project in Gitlab

I have a project in gitlab. My colleague has a maintaner status there. I have a developer status. He asked me to push a files there with a new branch. Then to merge request, in order he could check it and accept. But when I push, I get the following error:

remote: GitLab: You are not allowed to create protected branches on this project.

To ".../..../myProject"

! [remote rejected] myBranch -> myBranch (pre-receive hook declined)

error: failed to push some refs to '.../..../myProject'



Here's what I did:
git clone .... // cloned the project as there were already files

// then added my files to the cloned project, created a new branch and did add

    git add.
    
    git commit -m "..."
    
    git push origin myBranch
question from:https://stackoverflow.com/questions/65886771/can-not-create-protected-branch-in-this-project-in-gitlab

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If i'm not mistaken the problem is that by default GitLab only allows Maintainers to create new protected branches.

So maybe this has something to do with permissions in the repo, you should check in GitLab if you are using wildcards in the protected branches protection.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...