Git 设备上没有剩余空间

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14332320/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 15:16:09  来源:igfitidea点击:

Git no space left on device

gitgit-rebasegit-pull

提问by Rahul Tapali

I did git pull --rebaseand I got following error:

我做了git pull --rebase并且出现以下错误:

 error: file write error (No space left on device)
 fatal: unable to write sha1 file 
 fatal: unpack-objects failed

I have lot of space on my device. Don't know why it is showing this error.

我的设备上有很多空间。不知道为什么会显示这个错误。

First time I got this error.

我第一次遇到这个错误。

采纳答案by Matt

You're out of drive space. Delete some unusedfiles from anywhere on your machine. After you've done some housecleaning, you may think about running git gcto have git garbage collect your repository; if you've made lots of changes to git's objects recently - like can happen with a rebase - you can reclaim significant data from git itself. After giving git some breathing room (as gc will need a little wiggle room to copy data to new files as it works), git gcwill compact your git repository as much as is possible without losing your repository's history.

您的驱动器空间不足。从机器上的任何位置删除一些未使用的文件。在您完成一些大扫除之后,您可能会考虑运行git gc以让 git 垃圾收集您的存储库;如果您最近对 git 的对象进行了大量更改 - 就像 rebase 可能发生的那样 - 您可以从 git 本身回收重要数据。在给 git 一些喘息的空间后(因为 gc 需要一点回旋余地来将数据复制到新文件中),git gc将尽可能地压缩您的 git 存储库,而不会丢失存储库的历史记录。

回答by Matt

This is not an answer so much as a clarification of the problem and what the problem may actually be. I'm finding that GIT is spitting out this type of error code regularly when I have plenty of room on my Windows 8.1 system and drives.

这与其说是对问题的澄清,不如说是对问题的实际情况的澄清。我发现当我的 Windows 8.1 系统和驱动器上有足够的空间时,GIT 会定期吐出这种类型的错误代码。

After running 5 times and checking memory in Task Manager I found that each time system memory approached the max limit this error was triggered. It had nothing to do with available disk space, so while @Matt's answer may be correct for some cases, it's not correct for all of them.

在运行 5 次并在任务管理器中检查内存后,我发现每次系统内存接近最大限制时都会触发此错误。它与可用磁盘空间无关,因此虽然@Matt 的答案在某些情况下可能是正确的,但并非对所有情况都正确。

Task Manager reports a low proportion of memory used by GIT, but each time GIT runs it ramps up the memory used. This problem appears to be related to a memory leak in GIT.

任务管理器报告 GIT 使用的内存比例很低,但每次 GIT 运行时它都会增加使用的内存。此问题似乎与 GIT 中的内存泄漏有关。

回答by VonC

To add to the other answerstating:

添加到另一个答案中,说明:

each time GIT runs it ramps up the memory used. This problem appears to be related to a memory leak in GIT.

每次 GIT 运行时,它都会增加使用的内存。此问题似乎与 GIT 中的内存泄漏有关。

Git 2.20 (Q4 2018) is focused of squashing the last cases of memory leakage known in Git, plugging a handful of memory leaks in the ref-filter codepath.

Git 2.20(2018 年第 4 季度)的重点是消除 Git 中已知的最后一种内存泄漏情况,并在 ref-filter 代码路径中插入少量内存泄漏。

See commit f0062d3, commit deec6b8, commit 23941dd(18 Oct 2018) by Olga Telezhnaya (telezhnaya).
(Merged by Junio C Hamano -- gitster--in commit 9d00100, 30 Oct 2018)

提交f0062d3提交deec6b8提交23941dd(2018年10月18日)由奥尔加Telezhnaya( )telezhnaya
(由Junio C gitsterHamano合并-- --提交 9d00100 中,2018 年 10 月 30 日)



Git 2.24 (Q4 2019) corrects "for-each-ref" (and friends that shows refs did not protect themselves against ancient tags) did not record tagger names when asked to show "%(taggername)",.

Git 2.24(2019 年第 4 季度)更正了“ for-each-ref”(以及显示 refs 没有保护自己免受古代标签侵害的朋友)在要求显示“ %(taggername)”时没有记录标记者名称。

See commit 8b3f33e(17 Aug 2019) by Mischa POSLAWSKY (shiar).
(Merged by Junio C Hamano -- gitster--in commit a477abe, 09 Sep 2019)

请参阅Mischa POSLAWSKY ( ) 的提交 8b3f33e(2019 年 8 月 17 日(由Junio C Hamano合并-- --提交 a477abe 中,2019 年 9 月 9 日)shiar
gitster

ref-filter: initialize empty name or email fields

Formatting $(taggername)on headerless tags such as v0.99 in Git causes a SIGABRTwith error "munmap_chunk(): invalid pointer", because of an oversight in commit f0062d3(ref-filter: free item->value and item->value->s, 2018-10-19, Git v2.20.0-rc0).

ref-filter: 初始化空名称或电子邮件字段

格式化$(taggername)上无报头标记,如在GIT中v0.99导致SIGABRT错误“ munmap_chunk():因为在犯下监督,无效指针” f0062d3ref-filter:免费用品- >值和用品- >值- > S,2018年10月19日, Git v2.20.0-rc0)。

回答by metabuddy

In my case the .gitconfig was being stored on a network location, which essentially keeps all configuration files for my machine so, if the PC dies, corporation can restore the same configs on a new hardware. Anyhow, this network drive was out of space, so git couldn't update the file. Either you can increase the network drive space, or just disconnect it and git will use the local config which is on your main drive.

在我的情况下,.gitconfig 被存储在一个网络位置,它基本上保留了我机器的所有配置文件,因此,如果 PC 死机,公司可以在新硬件上恢复相同的配置。无论如何,这个网络驱动器空间不足,所以git无法更新文件。您可以增加网络驱动器空间,或者只是断开它,git 将使用主驱动器上的本地配置。

回答by Aline

I got this issue using the Git bash console. By using the windows console there where no more issue. i could clone the repository.

我使用 Git bash 控制台遇到了这个问题。通过在没有更多问题的地方使用 Windows 控制台。我可以克隆存储库。