場景回憶:
本地修改需要退回到之前的版本,打算強制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就好。
如圖: