【錯誤解決】git報錯:you are not allowed to push code to protected branches on this project


場景回憶:
本地修改需要退回到之前的版本,打算強制push本地版本覆蓋遠程版本,但是在git push --force后出現了以下的錯誤:
Fix GitLab error: “you are not allowed to push code to protected branches on this project”?

問題原因:
原來gitlab對應的分支進行分支保護設置。

解決方法:
"Settings" -> "Repository" -> scroll down to "Protected branches" 改成unprotected就好。

如圖:

參考來源:
https://stackoverflow.com/questions/32246503/fix-gitlab-error-you-are-not-allowed-to-push-code-to-protected-branches-on-thi


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM