git push解決辦法: ! [remote rejected] master -> master (pre-receive hook declined)
前天准備准備回退一個版本並且推送到遠程分支,但是試了很多次都上傳不上去,報錯如下:
! [remote rejected] master -> master (pre-receive hook declined)
截圖:
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 分支名
