Progress indicator for git clone

Olivier Lalonde picture Olivier Lalonde · Jan 9, 2011 · Viewed 22.1k times · Source

Is it possible to get a progress bar when doing a git clone? I'm wondering because I am currently doing a git clone that has taken a few minutes so far and would be curious to know if it is going to finish soon.

Answer

araqnid picture araqnid · Jan 9, 2011

Not really. There are various stages to git clone:

  1. discover the objects that need to be sent ("Counting objects: nnn")
  2. compress and send those objects
  3. index the received pack
  4. check out received files

Stage 1 involves walking through the commit graph from each branch head finding all the commits and associated objects: since there is no idea beforehand of how many commits there are, the progress of this can't be gauged. Sadly this is often where a lot of the time in a clone operation is taken up.

Stage 2 does have a progress counter, although it counts objects rather than volume (so its rate varies, especially if the repo has large blobs)

Stages 3 and 4 have progress counters, although they are usually much faster than the previous two stages.