Gitlab的develop角色的人沒有權限無法提交的問題解決方案


問題

事情是這樣的,最近跟幾位同事搞一些東西,打算在Gitlab上建一個倉庫,然后協同開發。

我建好倉庫,將其他幾位同事添加進來,角色分配為Develop。

image

 

之后提交初始代碼到master分支后,他們用sourceTree拉取代碼后進行開發,之后再提交時發現無法提交,提示沒有權限

image

如下:

錯誤提示:

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v origin master:master
Pushing to http://xxx/xxx/xxx_HTML.git

POST git-receive-pack (47642 bytes)

remote: GitLab: You don't have permission[K

To http://xxx/xxx/xxx_HTML.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://xxx/xxx/xxx_HTML.git'

 

解決方案

研究了下Gitlab,最終解決方案是:

在項目的【Setting】中的【Protected branches】可以設置哪些分支是被保護的,默認情況下【master】分支是處於被保護狀態下的,develop角色的人是無法提交到master分支的,在下面的【Developers can push】打上鈎就可以了。

image

 

還可以對某個分支做單獨設定,哪些分支可以被提交

image

(完)

原文地址-http://www.cnblogs.com/xxcanghai/p/5009926.html


免責聲明!

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



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