git push:You are not allowed to push code to protect。 error: failed to push some refs to 'git@gitlab

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u010918487/article/details/89010647

昨天中午带我的同事给新建了个项目,只有一个master分支,等开发完push代码的时候才发现法务push,报错如下:
 

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

今天带我的同事请假了没来上班,问了老大才知道是master分支是他在维护的。

网上看了也有大佬有遇到这个问题的,大致说的是master是一个protected branches。

解决

新开了一个分支如dev-v1.0.0,然后把代码push到了这个dev-v1.0.0上

猜你喜欢

转载自blog.csdn.net/u010918487/article/details/89010647