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

1、強制推送失敗,報錯

git push -f origin master

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

Master分支被保護:

進入項目gitlab 網頁版: 設置(Settings)-倉庫(Repository) -- 保護分支(Protected Branches)(把保護的分支選擇 unprotected)

再重新進行推送 git push -f origin master

Master分支重新加入保護:

進入項目gitlab 網頁版: 設置(Settings)-倉庫(Repository) -- 保護分支(Protected Branches)--選擇分支,Allowed to merge,Allowed to push(把保護的分支選擇protect )

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章