git push解决办法: ! [remote rejected] master -> master (pre-receive hook declined)
前天准备上传一个project到GitLab上,但是试了很多次都上传不上去,报错如下:
! [remote rejected] master -> master (pre-receive hook declined)
截图:

一开始还以为自己用户名和密码错误,试了好多次,网上搜所索也没搜索到明确的结果,不过最后还是找到了解决的办法。
git push不上去的原因在于所push的分支权限为protected,只有项目的管理员或者项目的管理员指派的具有相应权限的人才能进行push,要进行项目的push,有如下两种方法:
1.将所要push的内容所在的分支的protected权限关闭
(1)进入所在项目的settings

(2)点击进入Protected branches,点击unprotected将master分支的权限改变,即关闭master的protected权限

2.新建其它分支,将项目push到新建的分支上,后期再进行merge
(1)新建分支
git branch 分支名
(2)切换分支
git checkout 分支名
(3)进行项目上传
git add .
git commit -m "提交的信息"
git remote add origin 远程仓库地址
git push -u origin 分支名
git push解决办法: ! [remote rejected] master -> master (pre-receive hook declined)的更多相关文章
- Git push时报错 ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to......
今天在使用Git回退到之前某个版本的代码时,进行push时出现如下错误: ! [remote rejected] master -> master (pre-receive hook decli ...
- jenkins持续集成源码管理选项为None,构建失败找不到git.exe解决办法
我的jenkins版本为Jenkins ver. 2.19.1 1.源码管理选项只有None的解决办法: 在插件管理中心,搜索对应的源码管理插件这里以git为例,搜索git plugin点击右下角的安 ...
- git push fatal: The remote end hung up unexpectedly
git push fatal: The remote end hung up unexpectedly git config http.postBuffer git gc --aggressive 不 ...
- git push后出现错误 ![rejected] master -> master(non-fast-forward) error:failed to push some refs to 'XXX'
本地创建了一个project并在GitHub上创建了一个仓库,想要将本地的仓库链接到远程仓库我用的是如下方法:git init //初始化本地仓库git remote add origin XX ...
- 错误:error: failed to push some refs to 'https://github.com/pzq7025/KG.git'的解决办法
一.问题在进行[git push orgin master]的时候出现如下错误 ! [rejected] master -> master (non-fast-forward) error: f ...
- Git push 时如何避免出现 "Merge branch 'master' of ..."
在使用 Git 的进行代码版本控制的时候,往往会发现在 log 中出现 "Merge branch 'master' of ..." 这句话,如下图所示.日志中记录的一般为开发过程 ...
- 解决:git使用git push 命令跳出remote: Permission to A denied to B的问题
开始git上传项目,不料,在git push这一步骤发生了错误? remote: Permission to qwe2193066947/firstRepository.git denied to m ...
- git 冲突解决办法
1. Pull is not possible because you have unmerged files. 症状:pull的时候 $ git pull Pull is not possible ...
- linux git 报错提示 fatal: 'origin' does not appear to be a git repository 解决办法
输入: git pull origin master git报错提示 fatal: 'origin' does not appear to be a git repository fatal: Cou ...
随机推荐
- linux中常用的命令
1.向某个ip发送文件 scp name.tar root(身份)@ip:/lujing 2.重启系统 init 6 3.如果修改了ifcfg-eth0类似于网卡配置文件,修改网口,ip等设置: 需要 ...
- mongodb入门级的视频教程-简易客户管理系统制作
本套教程作为mongodb入门级的视频教程,首先讲解了mongodb的下载.安装,环境变量的设置.启动mongodb和将mongodb安装成为windows服务.然后进一步讲解了mongodb里面集合 ...
- HTML行内元素、块状元素、行内块状元素的区别
HTML可以将元素分类方式分为行内元素.块状元素和行内块状元素三种.首先需要说明的是,这三者是可以互相转换的,使用display属性能够将三者任意转换: (1)display:inline;转换为行内 ...
- php后台拼接输出table表格
<?php header("Content-type:text/html;charset=utf-8"); $str=''; $str.='<table border= ...
- 国内互联网公司github网址
-----------------------------------------------------推荐技术------------------------------------------- ...
- EventBus In eShop -- 解析微软微服务架构Demo(四)
引言 大家好像对分析源码厌倦了,说实在我也会厌倦,不过不看是无法分析其后面的东西,从易到难是一个必要的过程. 今天说下EventBus,前几天园里的大神已经把其解刨,我今天就借着大神的肩膀,分析下在e ...
- 手机cpu结构,arm
问题描述 今天测试人员测试集成版本时除了一个bug:关于华为 Mate 8手机Android 6.0系统运行刚刚提测的版本时,出现闪退的bug,而小米 4 手机Android 6.0系统却没有出现任何 ...
- Spring Security -SpEL表达式
Spring Security -SpEL表达式 开启SpEL表达式 <!-- use-expressions是否开启 SpEL表达式 o.s.s.web.access.expression.W ...
- 用py2exe将python文件转换成exe可执行程序
1.首先需要安装py2exe模块,下载地址:http://www.lfd.uci.edu/~gohlke/pythonlibs/ 然后用pip install 命令安装py2exe模块,如果你用的py ...
- 修改MySQL数据库密码
在mysql数据库里面有一个默认安装的数据库是mysql,里面有一个user表.里面的字段Host是运行登录的ip地址,User 是登录的账号Password是密码. use mysql;//使用my ...