Git push时报错 ! [remote rejected] master -> master (pre-receive hook declined) error:

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

Git push时报错 ! [remote rejected] master -> master (pre-receive hook declined) error:_第1张图片

查阅相关资料发现,是由于当前用户没有push权限,就是[master]代码默认是被保护的,所以进行push的时候会报错;

解决方案:

登录gitlab,选择对应的项目,点击[Setting],

Git push时报错 ! [remote rejected] master -> master (pre-receive hook declined) error:_第2张图片

选择[Protected Branches];

Git push时报错 ! [remote rejected] master -> master (pre-receive hook declined) error:_第3张图片

解除[master]的保护即可;

Git push时报错 ! [remote rejected] master -> master (pre-receive hook declined) error:_第4张图片

push完代码之后,再把[master]Protect起来即可;

Git push时报错 ! [remote rejected] master -> master (pre-receive hook declined) error:_第5张图片

 

转载请标明出处: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 declined) error: failed to push some refs to......

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