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
相关推荐
晨旭缘1 天前
GitLab CICD 中 K8s 部署:BOM 头与 YAML 格式全解
容器·kubernetes·gitlab
鳄鱼杆2 天前
服务器 | 2026年Ubuntu 24.04下GitLab Docker 企业级部署
服务器·ubuntu·gitlab
FreeBuf_3 天前
黑客滥用 GitHub 和 GitLab 托管恶意软件并实施凭证钓鱼攻击
gitlab·github
有理想的打工人6 天前
gitlab的参数设置与团队管理
gitlab
有理想的打工人6 天前
gitlab群组管理与ssh链接
ssh·gitlab
M-Ellen6 天前
从零搭建 Windows + WSL2 + Docker + GitLab CI/CD 完整手册
ci/cd·docker·gitlab
大脸胖柴7 天前
webStorm+gitLab操作学习
学习·gitlab·webstorm
jekc8688 天前
Ubuntu-GitLab
服务器·ubuntu·gitlab
在路上走着走着9 天前
openclaw v2026.4.5 版本 提示 pairing required 解决方案
gitlab
Gazer_S13 天前
【GitLab npm Registry 非标准端口安装问题解决方案】
前端·npm·gitlab