当推送到远程服务器时,我收到错误:
Counting objects: 58, done.
Compressing objects: 100% (35/35), done.
fatal: Out of memory, malloc failed (tried to allocate 595059947 bytes)
error: pack-objects died of signal 13
error: failed to push some refs to 'git@cassandra.predictioninstitute.com:development'"
Run Code Online (Sandbox Code Playgroud)
我认为问题是我不小心编写了一些非常大的日志文件.但我后来删除了它们(git rm logfile),但错误仍然存在.而且他们没有出现在"git status"中.我该如何从中恢复?
从你的评论中我无法判断你是反对重写历史,还是不反对。如果您不反对,此命令将从您的历史记录中删除大文件。
警告:这是破坏性的且不可逆转的。首先备份您的存储库。如果您不喜欢结果,您可以简单地恢复备份:
git filter-branch --index-filter 'git rm --cached --ignore-unmatch <file>' \
--prune-empty --tag-name-filter cat -- --all
Run Code Online (Sandbox Code Playgroud)
<file>该命令将从您的分支历史记录中删除。对每个给您带来麻烦的文件运行它。
| 归档时间: |
|
| 查看次数: |
5410 次 |
| 最近记录: |