解决github Push rejected报错 remote: error: GH013: Repository rule violations found for refs/heads/maste

这篇具有很好参考价值的文章主要介绍了解决github Push rejected报错 remote: error: GH013: Repository rule violations found for refs/heads/maste。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

问题

在push代码到master的时候Github 报错 remote: error: GH013: Repository rule violations found for refs/heads/main

这次是因为Github的保护机制引起rejected。错误如下:
error: gh013: repository rule violations found for refs/heads/main,测试工程师的VSCode环境配置,自动化测试,github
可见是因为疑似代码中有一些key可能会泄漏,(通过给出的帮助文档 https://docs.github.com/zh/code-security/secret-scanning/push-protection-for-repositories-and-organizations)

解决办法

修改代码或者关闭这个保护扫描,我选择关闭保护后push代码,然后再打开:)。
在个人设置中
error: gh013: repository rule violations found for refs/heads/main,测试工程师的VSCode环境配置,自动化测试,github
找到Security下的Code security and analysis。

error: gh013: repository rule violations found for refs/heads/main,测试工程师的VSCode环境配置,自动化测试,github
看到push protection for yourself 点击 disable后在推送代码就好了。
error: gh013: repository rule violations found for refs/heads/main,测试工程师的VSCode环境配置,自动化测试,github
一定记得push后打开,还是很有用的一个保护机制文章来源地址https://www.toymoban.com/news/detail-853156.html

到了这里,关于解决github Push rejected报错 remote: error: GH013: Repository rule violations found for refs/heads/maste的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Push rejected: Push master to origin/master was rejected by remote

    这问题折腾我一下午,头皮发麻,记录一下   push时总是出现Push rejected: Push master to origin/master was rejected by remote这个问题,按网上说的改权限也不行,改分支也不行,后来查着查着发现了一个很神奇的玩意儿  根据这篇文章https://www.cnblogs.com/bznxn77/p/14959663.html   把这玩意关了

    2024年02月12日
    浏览(62)
  • 【git报错】 push git remote: ERROR: committer email address remote

    使用git推送到分支的时候,会有这样报错: gerri push git remote: ERROR: committer email address remote: ERROR: does not match your user accoun   原因是: 本地配置的用户名邮箱配置错误 。(可能是之前拉取过别的仓库的代码)     修改配置方法: 配置用户名 查看已配置的用户名 配置邮箱 查看

    2024年02月16日
    浏览(34)
  • git push报错:![rejected] master -> master(non-fast-forward) error:failed to push some refs to XXX

    背景 本地git库,要push到gitlab上,执行完如下命令后报错: 报错信息为: 原因 从本地代码创建远程仓库的时候,添加了README.md,但本地仓库中并没有该文件。 解决方案 添加忽略不相干的历史选项,将远程仓库中的文件重新拉取到本地,这样本地文件会出现README.md: 之后再

    2024年02月04日
    浏览(49)
  • git push失败, 提示! [rejected] master -> master (fetch first)error: failed to push some refs.解决办法

    我们按照如下的步骤上传了一个项目到仓库的时候,是可以成功的: 1、git init 初始化 2、git add .  将当前目录下修改的所有代码从工作区添加到暂存区 3、git commit -m  [\\\'注释\\\']  将缓存区内容添加到本地仓库 4、git remote add origin 仓库地址  将本地仓库与远程仓库连接起来 5、

    2024年02月01日
    浏览(69)
  • Push master to origin/master was rejected by remote

    很多人 ,百度半天网上都是教你们按照他们的解决方案来,但你们真的懂原因吗?其实不见其然,所以本篇就告诉你怎么去找到问题的具体的报错和解决它。 很多人都是本地pull正常,push报错,而且基本都是报Push master to origin/master was rejected by remote这个错误,其实,大家可以

    2024年02月11日
    浏览(48)
  • ! [rejected] master -> master (fetch first)error: failed to push some refs to 解决方案

         ! [rejected]  master - master (fetch first)error: failed to push some refs to 解决方案  To https://gitee.com/xxxx.git  ! [rejected]        master - master (fetch first) error: failed to push some refs to \\\'https://gitee.com/xxxxx.0.git\\\' ! [拒绝]master -gt;Master(先取) 错误:未能向“https://gitee.com/cxxxxx0.git”推送一些引用

    2024年02月04日
    浏览(39)
  • 【Git异常】Push master to origin/master was rejected by remote

    今天新分配的git账号和新项目,拉下来代码更改后发现push不上去, 设置中 选择 Prorected Branches Allowed to push 更改 选择一个角色即可 ,而后 un protect

    2024年02月06日
    浏览(53)
  • git pull 报错 could not read from remote repository解决

    git pull 报错 remote: Your account has been blocked. fatal: could not read from remote repository。一般是SSH的形式clone的仓库,权限被更改了。 如下步骤解决: 重新 生成 gitLabKey 并应用:                  step 1:     使用命令 ssh-keygen -t rsa -b 2048 -C \\\"lvl@svtc.com\\\"                  step 2:     出现

    2024年02月16日
    浏览(26)
  • 解决git@github.com: Permission denied (publickey). Could not read from remote repository

    原因分析 Permission denied (publickey) 没有权限的publickey ,出现这错误一般是以下两种原因 客户端与服务端未生成 ssh key 客户端与服务端的ssh key不匹配 找到问题的原因了,解决办法也就有了,重新生成一次ssh key ,服务端也重新配置一次即可。 客户端生成ssh key 470812087@qq.com改为

    2024年02月04日
    浏览(51)
  • 解决git@github.com:Permission denied (publickey).fatal:Could not read from remote repository.

    1.打开Git Bash。 2.输入 ls -al ~/.ssh 以查看是否存在现有 SSH 密钥。 3.检查目录列表以查看您是否已有公共 SSH 密钥。默认情况下,GitHub 支持的公钥的文件名是以下之一: id_rsa.pub、 id_ecdsa.pub、 id_ed25519.pub。 如果您收到 ~/.ssh 不存在的错误,则说明您在默认位置中没有现有的 SS

    2024年02月12日
    浏览(45)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包