gitlab中的repo删除特定commit

最近代码提交的时候发现一个问题

我有一些缓存代码,推送到gitlab上,分支已经push-f 了,但是其他用户还是可以通过commitid来访问代码。然后我尝试了:

  1. 通过 Web 界面(需要 Maintainer 权限)

    Settings → General Settings → Advanced → Run housekeeping

  2. 本地GIT操作

sh 复制代码
# 安装 git-filter-repo
pip3 install git-filter-repo

# 从历史中删除特定文件
git filter-repo --path <file-path> --invert-paths

# 或删除包含敏感信息的 commit
git filter-repo --commit-callback '
  if commit.original_id in [b"<commit-id-1>", b"<commit-id-2>"]:
    commit.skip()
'

# 强制推送所有分支
git push origin --force --all
git push origin --force --tags

发现都没有生效,特别是Web 界面,操作2次之后,会提示

Somebody already triggered housekeeping for this resource in the past 1440 minutes

看起来原因是:

  • housekeeping 是资源密集型操作(CPU、磁盘 I/O)
  • 频繁执行可能影响 GitLab 服务器性能
  • 防止误操作或恶意行为

默认限制:

  • 手动触发间隔: 24 小时
  • 自动触发周期: 每 1000 次推送

我等了差不多1天,但是发现代码还是可以访问,最后是删除了repo,重新创建并上传

复制代码
Settings → General Settings → Advanced → Delete this project
相关推荐
极小狐2 天前
极狐GitLab万人并发架构实践,大规模组织的扩容路线图
架构·gitlab·极狐gitlab
Lvan的前端笔记3 天前
GitLab CI 环境变量整理
ci/cd·gitlab
李迟4 天前
CICD实例:解决GitLab Runner无法执行CICD问题
gitlab
hanjq_code6 天前
gitlab本地文件 跨分支 忽略改动 不提交
gitlab
极小狐6 天前
极狐GitLab集群高可用方案,多节点架构与故障自愈实践
架构·gitlab·高可用·极狐gitlab
极小狐7 天前
极狐GitLab主备同步延迟治理,复制滞后监控与优化方法
gitlab·极狐gitlab·geo容灾
极小狐7 天前
跨项目流水线报 404 Not Found?CI_JOB_TOKEN 允许名单 9 步排查
ci/cd·gitlab·devops·权限管理·流水线·极狐gitlab·作业令牌
极小狐8 天前
极狐GitLab双机热备搭建指南,主机备机部署与切换实操
gitlab·高可用·极狐gitlab
有同事要进步14 天前
如何在github或者是gitlab上创建空文件
gitlab·github
GoodStudyAndDayDayUp15 天前
gitlab私有化跑CICD
gitlab·gitlab私有化跑cicd