Push rejected: Push master to origin/master was rejected by remote报错处理

刚从git上clone下的项目,修改完代理后想要提交
commit成功,并且本地仓库已更新,当想推动到远程仓库时
\Terminal报错如下

[admin@MacBook-Pro ~/androidProject/test]$git push origin master
Counting objects: 11, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (11/11), 793 bytes | 793.00 KiB/s, done.
Total 11 (delta 6), reused 0 (delta 0)
remote: GitLab: You are not allowed to push code to protected branches on this project.
To 192.168.1.111:admin/test.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:admin/test.git'
[admin@MacBook-Pro ~/androidProject/test]$


\AndroidStudio报错如下

报错.png


在经过了上网一顿百度后,发现问题的关键
项目分支master设置为了受保护的状态
\如图

git.png

解决办法

1.取消项目master分支的受保护状态
git1.png

2.把你的开发者developer身份升级为master


git2.png

欢迎互相学习Github

你可能感兴趣的:(Push rejected: Push master to origin/master was rejected by remote报错处理)