git - 文件太大,添加到 git ignore 但仍在尝试添加
问题描述
我收到此错误
远程:错误:文件 _____ 为 262.63 MB;这超出了 GitHub 的文件大小限制 100.00 MB
所以我将文件添加到.gitignore。
但是它仍在尝试添加它。我需要做些什么才能让它工作吗?
解决方案
它可能仍被添加到您的 git 存储库中,因此您需要使用以下命令将其删除:
git rm --cached path/to/giant_file
# Stage your giant file for removal from the git repo
使用 --amend 提交此更改
git commit --amend -CHEAD
# Amend the previous commit with your change
最后,您可以像往常一样推送!
git push
# Push your smaller commit
推荐阅读
- python - 如何在 VS Code 中创建包含 django 应用程序设置的 python 控制台?
- javascript - 我想在我的下拉列表中使用 select2。这是我的代码。但它不起作用。我需要在 .cs 文件中写一些东西吗?
- python - 如何在列表 Comperhansion 的列表末尾附加 \n
- c - windows IDE和gcc之间源代码的兼容性?
- vue.js - 无法测试 Vue 组件,因为未定义 Vue 实例
- angularjs - 如何使用angular js保存html表格的多行数据
- spring - IllegalStateException:使用 Kotlin 业务逻辑的 Spock 单元测试不能为空
- travis-ci - 未在 Travis CI 上使用 Matrix 时“未设置环境变量”
- javascript - JavaScript/ES6 属性在构造函数中设置值时不使用 setter
- javascript - 如何在javascript中将选定的表行值发送到另一个页面