80

I'm trying to do a git pull from a remote repository in github into a local machine... but git gets stuck on 70% into the "Unpacking objects" phase, with no sign of going anywhere.. (left it for several hours now with no change)

Any suggestion on how to fix this issue?

Is it possible to instruct git to only download the latest commit/version from the remote repository without all the Intermediate states?

Krunal Sonparate
  • 915
  • 7
  • 23
gadgad
  • 801
  • 1
  • 6
  • 4
  • Even though you are using ssh, try http://stackoverflow.com/questions/6842687/the-remote-end-hung-up-unexpectedly-while-git-cloning/6849424#6849424 , just in case. – VonC Oct 11 '11 at 20:48
  • It more likely that the host hang up on that, perhaps you could try doing `git clone --depth 1`. Quite offen having a better internet connection helps a lot, e.g. in my experience cloning a Github repo on a Rackspace server is supper fast (hence you are within the same infrastructure and `github.com` servers might be near by). – errordeveloper May 25 '12 at 14:34
  • Don't commit binary files to git. Git is purely for version control. – Greg Sep 09 '14 at 17:08
  • I delete repository and clone it again. It helped me. – Gleb Belyaev Mar 23 '16 at 14:07

4 Answers4

59

I had the same problem when I git pull a repository on github.com. I found there were some large files and the connection to github was slow. So maybe you just have to wait patiently before git pulls the whole repository.

Ernest
  • 830
  • 7
  • 9
15

For me the solution was to change protocol specifier from https to git, e.g.:
git clone https://github.com/some/repository
to
git clone git://github.com/some/repository

Edit:
Here's something about the protocols used in Git.
Some highlights:
The downside of the Git protocol is the lack of authentication.
It also requires firewall access to port 9418, which isn’t a standard port that corporate firewalls always allow

Al Lelopath
  • 5,810
  • 12
  • 66
  • 120
4

I find that large binary objects (like Adobe Illustrator files, etc.) tend to bog the whole pull/push process down as well.

Which is why I like to use two repositories now for design vs. code.

Evan K. Stone
  • 1,099
  • 11
  • 14
  • First time getting stuck at the unpacking object phase. Then I realize I have two pdf files in the GitHub repository. I wonder... – Atlas7 Aug 04 '15 at 11:29
  • Shouldn't store binaries in git. They make binary stores for things like this. We use Artifactory. – Jason Templeman Feb 26 '21 at 23:52
0

[...] but git gets stuck on 70% into the "Unpacking objects" phase, with no sign of going anywhere

With Git 2.25 (Q1 2020), "git unpack-objects" used to show progress based only on the number of received and unpacked objects, which stalled when it has to handle an unusually large object.

It now shows the throughput as well.

See commit bae60ba (19 Nov 2019) by SZEDER Gábor (szeder).
(Merged by Junio C Hamano -- gitster -- in commit cf91c31, 05 Dec 2019)

builtin/unpack-objects.c: show throughput progress

Signed-off-by: SZEDER Gábor

'git unpack-objects' shows a progress line only counting the number of unpacked objects, so if some of the received objects are unusually large, then that progress might appear to be frozen while processing such a larger object.

I just stared at a seemingly stuck progress line for over half a minute, while 'git fetch' was busy receiving a pack with only a couple of objects (i.e. fewer than 'fetch.unpackLimit'), with one of them being over 80MB.

Display throughput in 'git unpack-objects' progress line, so we show that something is going on even when receiving and processing a large object.

Counting the consumed bytes is far away from the place that counts objects and displays progress, and to pass around the 'struct progress' instance we would have to modify the signature of five functions and 14 of their callsites: this is just too much churn, so let's rather make it file-scope static.

'git index-pack', i.e. the non-unpacking cousin of 'git unpack-objects' already includes throughput in its progress line, and it uses a file-scope static 'struct progress' instance as well.

Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283