25

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.

Russia Must Remove Putin
  • 374,368
  • 89
  • 403
  • 331
Rahul Tapali
  • 9,887
  • 7
  • 31
  • 44
  • 1
    possible duplicate of [Git Deploy - "file write error (No space left on device)"](http://stackoverflow.com/questions/4329730/git-deploy-file-write-error-no-space-left-on-device) – CharlesB Feb 17 '13 at 14:30

9 Answers9

17

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.

Matt
  • 10,434
  • 1
  • 36
  • 45
  • you mean files from /tmp or files from git – Rahul Tapali Jan 15 '13 at 06:39
  • Anywhere, really: your whole drive is crammed. Clear downloads, from /tmp, whatever it takes. Chase out those cobwebs. – Matt Jan 15 '13 at 06:41
  • 1
    hahaha!!! *rm -rf /tmp/**, *rm -rf /var/log/**, *cd / && find . -type f ! -name '*.gz' -exec gzip "{}" \;*. alternatively, get a larger capacity hard drive. – thang Jan 15 '13 at 06:45
  • 3
    I have lot of space on my device. I don't know why it is howing like this :( – Rahul Tapali Jan 15 '13 at 07:00
  • 6
    @checkit: check if you have free space on all filesystems, `/tmp` included. `df -h` might come handy. – mvp Jan 15 '13 at 07:17
7

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.

6

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.

roipoussiere
  • 5,142
  • 3
  • 28
  • 37
  • 1
    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. – jnotelddim May 18 '21 at 16:52
2

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

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

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.

HamsterWithPitchfork
  • 750
  • 1
  • 12
  • 21
0

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

Kevine
  • 110
  • 1
  • 1
  • 15
0

In my case,It's remote device ran out of space, not local machine.So if your local machine has enough space,maybe you should check the remote machine.

ge lin
  • 1
0

For me, this problem was solved by changing the branch name Initially, I was pulling my code from the wrong branch which was not present on my GitLab so maybe you are using the wrong branch name.

  • 1
    You had what's essentially a typo, but there's no indication that that was the case for the OP – camille Jan 28 '23 at 00:03
-3

I solved my problem in mac by doing space in my desk , if ur desk is full it will give error like this.

kallayya Hiremath
  • 3,560
  • 1
  • 13
  • 14