26

I added some files to the repo, committed, and attempted to push to Github:

$ git add .  
$ git commit -m 'bla'  
$ git push origin master

I am getting an error when I try to push to Github.

Counting objects: 84, done.  
Delta compression using up to 2 threads.  
error: pack-objects died of signal 9  
error: failed to push some refs to 'git@github.com:xxxxx/xxxxx.git'

All was working fine before I went on vacation 2 weeks ago. Nothing has changed in the interim as far as I know. The config file seems to be fine. And git push -f also generates the same errors as above.

mnagel
  • 6,189
  • 4
  • 28
  • 63
Michelle Williamson
  • 2,266
  • 4
  • 15
  • 19

7 Answers7

54

Try this:

git config --global pack.windowMemory "32m"
asjer
  • 641
  • 5
  • 4
  • ran into this problem on Cloud 9 workspace free account..Running this command worked! – NiRUS Jul 02 '16 at 11:45
  • Had a pack-objects died of signal 952 after running the command "git repack -a -d -f --window=250 --depth=250" on a newly constructed svn to git conversion, this fixed that is well. THANKS! – James Eby May 16 '17 at 15:26
  • Neither this nor `git config --global pack.windowMemory "4096m"` made any difference to me. – Sridhar Sarnobat Sep 28 '21 at 23:19
  • This solved the problem on a tiny AWS t4g.nano instance I am using for testing. – paradroid May 25 '22 at 20:05
7
    git repack -a -d -f --window=0
hetal
  • 111
  • 1
  • 4
  • 7
    Please have a look at [How do I write a good answer?](https://stackoverflow.com/help/how-to-answer), and consider [providing some explanations along with your code](https://meta.stackexchange.com/questions/114762), so that future users can follow your ideas/code more easily. - [From Review](https://stackoverflow.com/review/low-quality-posts/23943100) – HansHirse Sep 02 '19 at 06:03
  • This seems to be working for my bloated repo, unlike the most popular answer. – Sridhar Sarnobat Sep 28 '21 at 23:25
  • Someone please copy and paste the relevant parts from here: https://git-scm.com/docs/git-repack (but it will make the post long). – Sridhar Sarnobat Sep 28 '21 at 23:31
  • Correction: this made no difference to the size of mine, though the command did complete successfully. – Sridhar Sarnobat Sep 29 '21 at 20:45
1

I'm quite convinced you have a local problem and it's nothing to do with GitHub. A git push consists of the following steps:

  • local: delta compression of objects
  • net: Writing new compressed objects to remote repo via SSH
  • net: update refs in remote repo via SSH

Quite clearly, it's the first step that fails. You might be out of memory/swap?

SzG
  • 11,777
  • 4
  • 25
  • 38
1

On a FreeBSD box with a lean RAM profile and a large repository with many files, I started getting this error. The /var/log/messages file contained errors like this:

pid 93208 (git), jid 0, uid 1001, was killed: out of swap space

I was able to resolve this by adding a little more swap space temporarily.

Dave
  • 800
  • 1
  • 6
  • 17
0

In my case it was because the number of files that I wanted to add exceeded 100. If this is your problem you might want to push them in different commits.

Another explanation is that the files you want to push are too large.

-1

Please check the RAM usages, or create more space for swapfile

-8

Had this problem pushing to Gitlab.

Fixed it by adding .* to my .gitignore

i.e. ignored all files/folders e.g. .git beginning with .

ericgm
  • 55
  • 3