git報錯You are not allowed to force push code to a protected branch on this project

當咱們有時候回滾了代碼,想強制push到遠程倉庫的時候,git

git push origin --force

會報以下錯誤:gitlab

You are not allowed to force push code to a protected branch on this project

若是用的是gitlab版本庫,這說明gitlab對倉庫啓用了保護,須要在倉庫中設置一下:this

"Settings" -> "Repository" -> scroll down to "Protected branches".code

參考連接:在這裏blog

相關文章
相關標籤/搜索