git彻底删除某些文件(文件夹)在仓库中的记录

作者在 2026-02-10 03:31:31 发布以下内容
sudo apt install git-filter-repo

# 删除单个文件
git filter-repo --invert-paths --path secret.txt

# 删除整个文件夹
git filter-repo --invert-paths --path logs/

# 压缩优化
git gc --aggressive --prune=now
git repack -a -d --depth=250 --window=250

Git | 阅读 678 次
文章评论,共0条
游客请输入验证码
浏览3077233次
文章归档
最新评论
  • 静夜思:感受ai的强大魔力吧👍
  • 静夜思:-1是多核