3

So I am trying to use git push on a fairly large repo, but it always seems to get stuck at the end at POST git-receive-pack (71245363 bytes). I have tried this solution but it doesn't seem to have any effect. Thanks in advance...

$ git push origin master --verbose
Pushing to https://github.com/obiwac/AQUA-2.X-x86
Username for 'https://github.com': Obiwac
Password for 'https://Obiwac@github.com': 
Counting objects: 28, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (23/23), done.
Writing objects: 100% (28/28), 67.94 MiB | 7.77 MiB/s, done.
Total 28 (delta 6), reused 1 (delta 0)
POST git-receive-pack (71245363 bytes)
Inobulles
  • 156
  • 3
  • 13
  • What's your upload speed? Sending ~71 megabytes at 3 Mbit/sec (about .375 MB/sec) will take about 189 seconds, or a bit over 3 minutes. – torek Jan 11 '18 at 00:51
  • About 100kb/s but I let it run for quite a while (2 hours) – Inobulles Jan 11 '18 at 15:00
  • Hm, if that's 100 k *bytes* per second, straightforward division gives just under 12 minutes (~712.5 seconds); if that's *bits*, it jumps to 5700 seconds or about 1.6 hours. Two hours should probably suffice. Note that GitHub itself imposes limits on both repository size (soft limit) and object sizes (hard limit), though, and this seems likely to bump up against them at some point (https://help.github.com/articles/what-is-my-disk-quota/). – torek Jan 11 '18 at 15:41
  • I dont have that much in my repo. Just under 1MB. And yes that was kilo *bits* per second – Inobulles Jan 12 '18 at 18:51
  • The output (`POST ... 71245363 bytes`) tells you how much data it's sending. If your repository is small, the next question might be: why is that POST so big? – torek Jan 12 '18 at 21:31

2 Answers2

2

Pretty old question, but I wanted to give closure since I've long since fixed this.

Previous to me trying to push my repo, I had accidentally committed a very big file and, trying to resolve the issue, proceeded to delete it and create another commit.

What I didn't know is that, even if you delete it afterwards, git still keeps a record of that file and that commit, and it still needs to push it.

The solution was thus to "undo" the last commit, by running something such as this:

$ git reset --hard HEAD~1

This will put our head back one commit. The --hard argument just means we want to discard all the changes we introduced, instead of preserving them.

Hope this helps someone somewhere, and have a nice evening!

Inobulles
  • 156
  • 3
  • 13
1

It is important to inspect the folder/directory first before performing @Inobulles answer. You could wreck your repo if you just git reset --hard HEAD~1. The main problem here is your directory is large and your upload speed might be slow. Just switch to a faster internet or wait it out.

Otherwise, Insepect your directory and git status ensure you are not upload a huge folder in your disk. You can git init in the directory again just to be sure.

cigien
  • 57,834
  • 11
  • 73
  • 112