V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
guoguobaba
V2EX  ›  程序员

github 上犯了个低级错误,怎么补救

  •  
  •   guoguobaba · 1 天前 · 3417 次点击

    项目里,fork 了一个项目,弄完了心想回馈一下作者,就从我的私有 gitlab 里 push 到 github ,然后点了一下 pull request

    但是忘了 squash commit ,中间版本还能看到我的.gitlab-ci.yml

    这玩意还删不掉,只能 close pull request

    好在敏感信息都是变量,里面就一个私有的 docker 镜像地址。

    第 1 条附言  ·  19 小时 34 分钟前
    后续:发工单解决问题了
    13 条回复    2025-11-20 15:40:13 +08:00
    CodeCaster
        1
    CodeCaster  
       1 天前
    强制推送覆盖可以解决么?
    Shorekeeper
        2
    Shorekeeper  
       1 天前
    https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository#fully-removing-the-data-from-github

    Contact us through the GitHub Support portal, and provide the following information:

    The owner and repository name in question (e.g. YOUR-USERNAME/YOUR-REPOSITORY).
    The number of affected pull requests, found in the previous step. This is used by Support to verify you understand how much will be affected.
    The First Changed Commit(s) reported by git-filter-repo (Look for NOTE: First Changed Commit(s) in its output.)
    If NOTE: There were LFS Objects Orphaned by this rewrite appears in the git-filter-repo output (right after the First Changed Commit), then mention you had LFS Objects Orphaned and upload the named file to the ticket as well.

    If you have successfully cleaned up all references other than PRs, and no forks have references to the sensitive data, Support will then:

    Dereference or delete any affected PRs on GitHub.

    Run a garbage collection on the server to expunge the sensitive data from storage.

    Remove cached views.

    If LFS Objects are involved, delete and/or purge the orphaned LFS objects.

    Important

    GitHub Support won't remove non-sensitive data, and will only assist in the removal of sensitive data in cases where we determine that the risk can't be mitigated by rotating affected credentials.
    DefoliationM
        3
    DefoliationM  
       1 天前
    可 github 发工单,提供 pr 和 commit 的 hash ,可以帮你永久删掉的,实测过,很快。
    guoguobaba
        5
    guoguobaba  
    OP
       1 天前
    @Shorekeeper 好像要 repository owner 才能删除 Pull requests
    xiyuesaves
        6
    xiyuesaves  
       1 天前
    可以直接发邮件给 [email protected] 叫他们帮忙删除

    Seck
        7
    Seck  
       1 天前
    @guoguobaba PR 记录可以 close 后,被彻底删除
    wenrouxiaozhu
        8
    wenrouxiaozhu  
       1 天前
    @CodeCaster 不能,之前的 commit 会变成 dangling commit...有 commitID 的人通过链接还是可以访问的...
    loloX
        9
    loloX  
       1 天前
    你肯定要发工单。被 push 到远程的 git object (也就是你的 commit )只能让 server 的管理员删除。

    !!!楼上说的删除 PR 是没用的。
    CodeCaster
        10
    CodeCaster  
       21 小时 55 分钟前
    @Seck github 上的 PR 在 close 之后可以被删除么?我之前好像没有找到
    guanzhangzhang
        11
    guanzhangzhang  
       21 小时 36 分钟前
    提工单解决你这个问题后,再整一个 pr ,gitlab-ci 的时候从某个.gitignore 的文件读取使用(本地开发者写这个被 ignore 的文件配置即可),这样保证后续的人员不会像你这样犯错
    Seck
        12
    Seck  
       19 小时 45 分钟前
    @CodeCaster #10 确实不行
    JqbR001
        13
    JqbR001  
       15 小时 31 分钟前
    原来很多问题发工单就能解决。
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   1064 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 23:11 · PVG 07:11 · LAX 15:11 · JFK 18:11
    ♥ Do have faith in what you're doing.