首页 > 解决方案 > 如何忽略为 git 管理的文件或文件夹历史记录?

问题描述

我的项目中有许多缓存文件可用于单元测试,因此我的 .git 文件夹有 3 GB 并且还在增加。

编辑。

我不想忽略文件,但历史并不重要,我的目标是减少 .git 文件夹

标签: git

解决方案


从工作树和索引中删除文件

查看使用的命令选项

git rm -r -n --cached file or directory
git rm -r --cached file
// Add these files or directories to the .gitignore file
// commit and push to warehouse

推荐阅读