git push解决办法: ! [remote rejected] master -> master (pre-receive hook declined)

git push解决办法: ! [remote rejected] master -> master (pre-receive hook declined)

 

前天准备准备回退一个版本并且推送到远程分支,但是试了很多次都上传不上去,报错如下:

! [remote rejected] master -> master (pre-receive hook declined)

截图:

 

 

1.将所要push的内容所在的分支的protected权限关闭

(1)进入所在项目的settings

git push解决办法: ! [remote rejected] master -> master (pre-receive hook declined)_第1张图片

 

 

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

git push解决办法: ! [remote rejected] master -> master (pre-receive hook declined)_第2张图片

 

 

2.新建其它分支,将项目push到新建的分支上,后期再进行merge

(1)新建分支

git branch 分支名

(2)切换分支

git checkout 分支名

(3)进行项目上传

git add .

git commit -m "提交的信息"

git remote add origin 远程仓库地址 git push -u origin 分支名

转载于:https://www.cnblogs.com/xuLessReigns/p/11539952.html

你可能感兴趣的:(git,运维)