当前位置: 首页 > news >正文

git push出错Push cannot contain secrets

报错原因:

因为你的代码里面包含了github token明文信息,github担心你的token会泄漏,所以就不允许你推送这些内容。

解决办法:

需要先把代码里面的github token信息删除掉,并且删掉之前的历史提交,只要包含token的提交,都要删除掉。

或者按照官方给的解决办法:Working with push protection from the command line - GitHub Docs

然后再次提交,就可以了

 详细的报错:

git push

Enumerating objects: 40, done.

Counting objects: 100% (40/40), done.

Delta compression using up to 8 threads

Compressing objects: 100% (26/26), done.

Writing objects: 100% (28/28), 8.67 KiB | 4.33 MiB/s, done.

Total 28 (delta 16), reused 0 (delta 0), pack-reused 0

remote: Resolving deltas: 100% (16/16), completed with 9 local objects.

remote: error: GH013: Repository rule violations found for refs/heads/main.

remote: 

remote: - GITHUB PUSH PROTECTION

remote:   —————————————————————————————————————————

remote:     Resolve the following violations before pushing again

remote: 

remote:     - Push cannot contain secrets

remote: 

remote:     

remote:      (?) Learn how to resolve a blocked push

remote:      https://docs.github.com/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-from-the-command-line#resolving-a-blocked-push

remote:     

remote:     

remote:       —— GitHub Personal Access Token ——————————————————————

remote:        locations:

remote:          - commit: 28e55de0d31e3a863b7e252ef802230b56b13092

remote:            path: src/apis/common.ts:8

remote:          - commit: 28e55de0d31e3a863b7e252ef802230b56b13092

remote:            path: src/utils/http.ts:56

remote:     

remote:        (?) To push, remove secret from commit(s) or follow this URL to allow the secret.

remote:        https://github.com/Sjj1024/PakePlus/security/secret-scanning/unblock-secret/2mDtj7K5gyE4MfiZ7e8IyJqZfaK

remote:     

remote: 

remote: 

To github.com:Sjj1024/PakePlus.git

 ! [remote rejected] main -> main (push declined due to repository rule violations)

error: failed to push some refs to 'github.com:Sjj1024/PakePlus.git'

http://www.lryc.cn/news/441125.html

相关文章:

  • OpenAI 的最强模型 o1 的“护城河”失守?谷歌 DeepMind 早已揭示相同原理
  • 【胡乱念叨】大模型的“我”
  • Flag_AGtivity_clear_top网页编程指南如何退出多activity程序
  • 克隆centos网卡uuid相同如何修改
  • C语言习题~day11
  • Ansible——Playbook基本功能???
  • 多线程学习篇一:启动多线程的三种方式
  • 【专题】2024跨境出海供应链洞察-更先进供应链报告合集PDF分享(附原数据表)
  • git submodule
  • 【Power Compiler手册】13.UPF多电压设计实现(3)
  • RTX 4090 系列即将停产,RTX 5090 系列蓄势待发
  • 【MySQL】使用C语言连接数据库
  • Vue学习记录之四(watch侦听器和watchEffect高级侦听器)
  • RedisTemplate操作ZSet的API
  • Android 15 正式发布至 AOSP
  • IEEE Electronic Library(IEL)数据库文献检索下载介绍及个人获取IEEE文献途径
  • 动手学习RAG:大模型重排模型 bge-reranker-v2-gemma微调
  • 蓝桥杯2024省C
  • C++:内部类,匿名对象,操作符new与delete
  • 【数据结构】排序算法---计数排序
  • mysql时间日期函数、获取当前日期和时间、日期和时间格式化、提取日期部分、日期和时间的算术操作、其他日期函数、日期和时间的比较、日期字符串转换
  • Android开发高频面试题之——kotlin篇
  • 8--SpringBoot原理分析、注解-详解(面试高频提问点)
  • 语言的枚举
  • C# Redis 框架开发技术详解
  • Rust:Result 和 Error
  • Python基础(八)——MySql数据库
  • 统一网关--gateway(仅供自己参考)
  • 【Leetcode152】分割回文串(回溯 | 递归)
  • 基于BiGRU+Attention实现风力涡轮机发电量多变量时序预测(PyTorch版)