git合並分支成功,但是push失敗(remote: GitLab: You are not allowed to push code to protected branches on this project.)


緊急修復修改代碼之后需要合並分支到master分支並push到線上,但是merge成功,push卻失敗了,報錯如下:

➜  buzzextractor git:(master) git merge hotfix
Updating 4668fce..9527ae9
Fast-forward
 build_online_images.sh           | 2 +-
 extractor/buzz/lib/utils.py      | 2 +-
 extractor/conf/config.ini.bushu  | 2 +-
 extractor/conf/config.ini.online | 2 +-
 extractor/conf/config.ini.test   | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
➜  buzzextractor git:(master) git status 
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean
➜  buzzextractor git:(master) git push origin master
Total 0 (delta 0), reused 0 (delta 0)
remote: GitLab: You are not allowed to push code to protected branches on this project.
To http://code.admaster.co/social-base/buzzextractor.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://houcaiyun@code.admaster.co/social-base/buzzextractor.git'

經過分析查證發現是自己沒有合並代碼的權限導致的,所以接下來就是修改權限就可以了。

一般我們作為developer,是沒有master權限的,只有master才有合並代碼權限。

修改方法,聯系管理員,打開gitlab ===> setting ===> 修改成員角色,就ok了(因為我不是管理員所以沒有圖截給大家啦。。。)

希望對你有幫助~


免責聲明!

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



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