1.1 Bug场景:
1.1 向远程仓库Push代码出现 拒绝推送 [remote rejected] master -> master (pre-receive hook declined)
2.1 Bug原因:
git push不上去的原因在于所push的分支权限为protected,只有项目的管理员或者项目的管理员指派的具有相应权限的人才能进行push
3.1 解决方法:
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 分支名