remote: GitLab: You are not allowed to push code to protected branches on this project

在win10上面使用git,然後拉取代碼,在使用命令行和idea提交的時候,一直報錯

remote: GitLab: You are not allowed to push code to protected branches on this project.
To http://xxx/xx/x.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://xxx/xx/x.git'

在百度上各種百度,大部分都在說git遠端版本庫權限問題,gitlab搭建的版本服務器,在版本中心一般人有兩個角色權限,developer,master,如果分配了developer角色確實不能對master分支進行提交,如果是master角色是可以提交的,我在版本庫上面看過,確實賦予了master分支的權限,最後經過同事幫助,才知道windows10系統的原因,

控制面板-->用戶賬戶-->下面有個憑證管理器:分爲管理web憑據和管理Windows憑據

點開管理Windows憑據,看到下面的普通憑據

開頭類似: git:http://xxx.xxx.com 下面查看一下是不是公司分配給你的賬號名和密碼,我這邊出現這個問題是因爲上一個人使用了,git訪問這個倉庫地址,Windows自己記錄了,每次提交的時候不會檢驗權限,所以導致一直提交失敗,

這裏可以嘗試使用git工具,而不是直接使用原生的git或者idea自帶的(這個兩個確實沒有跳出登錄驗證)。

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