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

1 天前
 guoguobaba

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

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

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

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

3314 次点击
所在节点    程序员
13 条回复
CodeCaster
1 天前
强制推送覆盖可以解决么?
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
1 天前
可 github 发工单,提供 pr 和 commit 的 hash ,可以帮你永久删掉的,实测过,很快。
DefoliationM
1 天前
guoguobaba
1 天前
@Shorekeeper 好像要 repository owner 才能删除 Pull requests
xiyuesaves
1 天前
可以直接发邮件给 developer@githubsupport.com 叫他们帮忙删除

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

!!!楼上说的删除 PR 是没用的。
CodeCaster
11 小时 40 分钟前
@Seck github 上的 PR 在 close 之后可以被删除么?我之前好像没有找到
guanzhangzhang
11 小时 20 分钟前
提工单解决你这个问题后,再整一个 pr ,gitlab-ci 的时候从某个.gitignore 的文件读取使用(本地开发者写这个被 ignore 的文件配置即可),这样保证后续的人员不会像你这样犯错
Seck
9 小时 29 分钟前
@CodeCaster #10 确实不行
JqbR001
5 小时 16 分钟前
原来很多问题发工单就能解决。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1173764

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX