git - 如何忽略为 git 管理的文件或文件夹历史记录?
问题描述
我的项目中有许多缓存文件可用于单元测试,因此我的 .git 文件夹有 3 GB 并且还在增加。
编辑。
我不想忽略文件,但历史并不重要,我的目标是减少 .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
推荐阅读
- c++ - 如何计算结构的哈希
- excel - 如何将数据从水平复制和粘贴到垂直
- push-notification - 在 Xcode 11.3 上使用 PushKit 而不使用 CallKit 将不再终止应用程序
- android - KotlinTest 与 Mockk 的并行性
- ios - xcuitest - 无法在 webview 中找到元素
- copy - 从 Eclipse RAP GridTableViewer 复制数据
- android - 发生崩溃时如何安全地报告 Lua 堆栈跟踪?
- python-3.x - AWS Cognito 90 天自动密码轮换
- java - 如何在资产中设置“其他语言的文件夹”?
- node.js - 使用 sequelize 将数据库前缀附加到表名