Git能够提交能够pull但不能push,报错:! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs
VScode修改代码后,能够提交commit注释,能够pull,但是无法push到gitee,使用
git push origin master 或 git push orgin --force 仍然报错:
! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs
无论是切换分支(但只有一个),还是删除本地库,重新clone,还是重新配置SSH秘钥,仍然报此错误,只能pull,不能push。
后面猜测可能提交的文件中存在某些文件影响了审核,
于是改换远程仓库gitee为codeberg,重新建立仓库,下拉后重新提交,发现提交OK。
总结:
1.提交者权限不够(多分支,或多用户协同开发时,授权问题)。解决:管理员重新授权;
2.文件敏感,被强制暂停提交权限。解决:换远程仓库;

浙公网安备 33010602011771号