Git no space left on device

44,903

Solution 1

You're out of drive space. Delete some unused files from anywhere on your machine. After you've done some housecleaning, you may think about running git gc to 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 gc will compact your git repository as much as is possible without losing your repository's history.

Solution 2

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.

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.

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.

Solution 3

I had a similar error when pushing to a remote, and actually it was not due to no enough space on my local machine, but on the Git server.

Just check the full error, for instance I got:

Failed to write to log, write /var/log/gitlab/gitlab-shell/gitlab-shell.log: no space left on device

informing me that the error came from gitlab-shell, not git.

Solution 4

To add to the other answer stating:

each time GIT runs it ramps up the memory used. This problem appears to be related to a memory leak in 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.

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)


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)",.

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

ref-filter: initialize empty name or email fields

Formatting $(taggername) on headerless tags such as v0.99 in Git causes a SIGABRT with 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).

Share:
44,903

Related videos on Youtube

Rahul Tapali
Author by

Rahul Tapali

Updated on January 26, 2022

Comments

  • Rahul Tapali
    Rahul Tapali over 2 years

    I did git pull --rebase and I got following error:

     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.

  • Rahul Tapali
    Rahul Tapali over 11 years
    you mean files from /tmp or files from git
  • Dawn Chen
    Dawn Chen over 11 years
    Anywhere, really: your whole drive is crammed. Clear downloads, from /tmp, whatever it takes. Chase out those cobwebs.
  • thang
    thang over 11 years
    hahaha!!! rm -rf /tmp/*, rm -rf /var/log/*, cd / && find . -type f ! -name '.gz' -exec gzip "{}" \;*. alternatively, get a larger capacity hard drive.
  • Rahul Tapali
    Rahul Tapali over 11 years
    I have lot of space on my device. I don't know why it is howing like this :(
  • mvp
    mvp over 11 years
    @checkit: check if you have free space on all filesystems, /tmp included. df -h might come handy.
  • jnotelddim
    jnotelddim almost 3 years
    Similarly, my coworkers and I are seeing this error and it doesn't seem to have to do with our local disk space. We suspect it's an issue with the GitLab server, and are looking into it now.