梦应逍遥 发表于 2024-8-20 20:01:51

办理github Push rejected报错 remote: error: GH013: Repository rule vio

题目

在push代码到master的时候Github 报错 remote: error: GH013: Repository rule violations found for refs/heads/main
这次是因为Github的掩护机制引起rejected。错误如下:
https://i-blog.csdnimg.cn/blog_migrate/1ad1585ba70c7036c490500b364dc537.png
可见是因为疑似代码中有一些key可能会泄漏,(通过给出的帮助文档 https://docs.github.com/zh/code-security/secret-scanning/push-protection-for-repositories-and-organizations)
办理办法

修改代码大概关闭这个掩护扫描,我选择关闭掩护后push代码,然后再打开:)。
在个人设置中
https://i-blog.csdnimg.cn/blog_migrate/a3ea9313f4db6fe2f67994f8a5476bbb.png
找到Security下的Code security and analysis。
https://i-blog.csdnimg.cn/blog_migrate/66de0882fde4744708c9da4df28c3229.png
看到push protection for yourself 点击 disable后在推送代码就好了。
https://i-blog.csdnimg.cn/blog_migrate/c0e7eec3df53aefc75da9891949f2b44.png
肯定记得push后打开,还是很有用的一个掩护机制

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: 办理github Push rejected报错 remote: error: GH013: Repository rule vio