我正在尝试推送一堆包含大量代码和几千个 MP3 和 PDF 文件的提交(每个文件范围为 5-40 MB)。
Git成功打包对象:
C:\MyProject> git push
Counting objects: 7582, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (7510/7510), done.
但由于一些未知的原因,它未能发送推送。
问题是重新打包文件需要很长时间(我使用的是电池供电的笔记本电脑,打包大约需要 20 分钟)。
所以我想我的问题可以是这样的短语:
- 是否可以保存在空运行中创建的打包对象?
- 保存后,是否可以推送那些打包的对象并避免重新打包?
我在 git 手册和其他地方查找了它,但找不到任何结论。
任何帮助或指针表示赞赏。
编辑- 添加了错误消息:
我第一次从命令行(`git push')运行它时,我得到了这个错误:
fatal: sha1 file '<stdout>' write error: Invalid argument
error: pack-objects died with strange error
error: failed to push some refs to 'account@server:project.git'
第二次(git push origin master -v
)我收到此错误:
Pushing to account@server:project.git
Counting objects: 7582, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (7510/7510), done.
fatal: sha1 file '<stdout>' write error: Invalid argument
error: pack-objects died with strange error
error: failed to push some refs to 'account@server:project.git'
请注意,在这两种情况下,压缩完成后,我都得到了这个对话框:
---------------------------
PuTTY Fatal Error
---------------------------
Network error: Software caused connection abort
---------------------------
OK
---------------------------
当对话框打开时,控制台显示如下(“Writing objects”行在单击 OK 后被删除):
Pushing to account@server:project.git
Counting objects: 7582, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (7510/7510), done.
Writing objects: 0% (1/7525)
编辑 2 -git gc
按照 Charles Bailey 的建议运行后,我在大约 1.5 小时后得到以下输出:
C:\Projects\MyProject>git gc
Counting objects: 10926, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (10125/10125), done.
warning: failed utime() on c:/Projects/MyProject/.git/objects/.tmp-10596-pack-a3a5ef775308593167a669b19aa752d2f484f768.pack: Permission denied
warning: failed utime() on c:/Projects/MyProject/.git/objects/.tmp-10596-pack-380270a0b5f3c7d30731c8e19f9271a59ea05e3d.pack: Permission denied
Writing objects: 100% (10926/10926), done.
Total 10926 (delta 719), reused 10858 (delta 719)
mv: cannot move `/c/Projects/MyProject/.git/objects/pack/pack-5dc233ff7aa1c33fc4845251186d5bafcefe3a11.pack' to `/c/Projects/MyProject/.git/objects/pack/old-pack-5dc233ff7aa1c33fc4845251186d5bafcefe3a11.pack'
error: failed to run repack