8

I try to push some file to Github and total size is only 22.2M. I don't know why it stuck after the total line. I've read the Git push hangs when pushing to Github? and tried each answer but it doesn't work at all. Does it works fine? Do I have any method to accelerate this process?

Counting objects: 203, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (176/176), done.
Writing objects: 100% (203/203), 22.12 MiB | 15.70 MiB/s, done.
Total 203 (delta 23), reused 0 (delta 0)
Community
  • 1
  • 1
Coding_Rabbit
  • 1,287
  • 3
  • 22
  • 44
  • Your output shows a completed push. It's not clear what if anything is happening at that point. – torek Aug 18 '16 at 01:00
  • 1
    Check this answer: http://stackoverflow.com/questions/2702731/git-fails-when-pushing-commit-to-github – Derick Alangi Aug 18 '16 at 01:01
  • 2
    If a push is successful, it'll show sth. like `To https://github.com/project fb0ba24..b6b5d9 master -> master`. This time it doesn't. – Coding_Rabbit Aug 18 '16 at 01:02

3 Answers3

32

I encountered the same issue on one of my repos when trying to push a number of larger commits at once. Multiple attempts wouldn't proceed past the Total output row. I first tried a couple of things suggested in other questions:

  • Increasing the http buffer size, git config --global http.postBuffer 150000000 (~150MB)
  • Waiting 8 hours in case of issues at Github's server

Neither seemed to help. Git push still wouldn't get past the 'Total' line in the terminal, no matter how long I waited.

Solution: After taking a precautionary backup, I issued the garbage collection command to the repo:

git gc

The next git push then worked immediately.

jt_uk
  • 1,362
  • 1
  • 15
  • 17
0

I found that setting the upstream origin solved it for me.

git push --set-upstream origin branchName
Ger Mc
  • 630
  • 3
  • 11
  • 22
0

Sometimes there may be an error caused by the terminal. Closing and reopening the terminal solved the problem for me.