优化Linux GitLab存储空间可从以下方面入手:
git branch -d branch_name
,git push origin --delete branch_name
。git filter-repo
或BFG Repo Cleaner移除历史大文件。git lfs prune
。/etc/gitlab/gitlab.rb
中设置git_data_dirs
指向其他分区。git gc --aggressive --prune=now
压缩仓库。prometheus['storage.tsdb.retention.time'] = "2d"
)。git clone --depth 1
仅保留最新提交)。操作前建议备份数据,部分步骤(如修改存储路径、重写历史)需在非生产环境测试。