Message "You are not allowed to push code to protected branches on this project" is Displayed
Symptom
When you push code to a repository, the message You are not allowed to push code to protected branches on this project is displayed.
Analysis
The branch to be pushed is a protected, and the user does not have the permissions to push code to the branch.
Solution 1: Modify the Protected Branch Settings
On the repository details page, choose Protected Branches in the User Guide.
to unprotect the branch. For details, see![Click to enlarge](https://support.huaweicloud.com/eu/codeartsrepo_faq/en-us_image_0000001639248550.png)
![Click to enlarge](https://support.huaweicloud.com/eu/codeartsrepo_faq/en-us_image_0000001687489729.png)
Solution 2: Change the Role of the User in the Repository
Go to the CodeArts Repo details page, click the Members tab page, search for the target user, click the administrator setting icon , and modify the repository member role to set the member as the repository administrator. For details, see Configuring Member Management in the User Guide.
![Click to enlarge](https://support.huaweicloud.com/eu/codeartsrepo_faq/en-us_image_0000001687452225.png)
Troubleshooting FAQs
- Private Key Is Lost
- SSH Key Already Exits
- Git Keeps Asking for Passphrase During Code Clone via SSH
- Password Incorrect During Code Clone via HTTPS
- Committed Files Cannot Be Found in the Cloud Repository
- Message "pathspec XXX did not match any files" Is Displayed
- Message "Transport Error: cannot get remote repository refs. XXX.git: cannot open git-upload-pack" Is Displayed
- Message "syntax error near unexpected token `newline'" Is Displayed
- Message "unable to auto-detect email address" Is Displayed
- Message "fatal:Authentication failed" Is Displayed
- Message "'origin' does not appear to be a git repository" Is Displayed
- Message "You are not allowed to push code to protected branches on this project" is Displayed
- Message "Not a git repository" Is Displayed
- Message "src refspec master does not match any" Is Displayed
- Message "destination path 'XXX' already exists and is not an empty directory" Is Displayed
- Message "The requested URL returned error: 401" Is Displayed
- Code Push Fails
- Code Pull Fails
- Message "fatal: refusing to merge unrelated histories" Is Displayed
- Message "SSL certificate problem" Is Displayed
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.
more