Git push时报错 ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to......
程序员文章站
2022-04-08 23:35:18
今天在使用Git回退到之前某个版本的代码时,进行push时出现如下错误: ! [remote rejected] master -> master (pre-receive hook declined)...... 查阅相关资料发现,是由于当前用户没有push权限,就是[master]代码默认是被保 ......
今天在使用git回退到之前某个版本的代码时,进行push时出现如下错误:
! [remote rejected] master -> master (pre-receive hook declined)......
查阅相关资料发现,是由于当前用户没有push权限,就是[master]代码默认是被保护的,所以进行push的时候会报错;
解决方案:
登录gitlab,选择对应的项目,点击[setting],
选择[protected branches];
解除[master]的保护即可;
push完代码之后,再把[master]protect起来即可;
上一篇: 金缕玉衣的灵感
下一篇: 操作集合的工具类Collections
推荐阅读
-
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......
-
git使用报错 ! [rejected] master -> master (fetch first) error: failed to push some refs to '略‘