Progress indicator for git clone

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.

  • Automatic prune with git fetch or pull
  • git clone writes to sderr, fine but why can't I redirect to stdout
  • Decoding git objects / “Block length does not match with its complement” error
  • BitBucket - How to retrieve all repository urls from a server
  • How to see the commit messages that origin/master is ahead of master?
  • Git: how is a branch I'm not committing to ahead of origin/master
  • Eclipse Luna file names not shown in GIT Commit Changes dialogue
  • How to create a remote repository via SSH?
  • Simulate multiple users/committer's on local system
  • Error when push commits with Github: fatal: could not read Username
  • How do I merge between multiple forked repositories on GitHub?
  • Suppressing diffs for deleted files in git
  • 5 Solutions collect form web for “Progress indicator for git clone”

    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.

    You can do:

       du -s .git
    

    to monitor changes in the size of temporary content to get an idea.

       watch du -s .git
    

    allows you to monitor without having to retype the command. Something like the one-liner below will give periodically you the data accumulation rate in kB per second:

        delay=5; prev=`du -sk .git/ | cut -f 1`; sleep $delay; while true; do  cur=`du -sk  .git/ | cut -f 1`; expr \( $cur - $prev \) / $delay ; prev=$cur; sleep $delay; done
    

    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.

    With Git 2.10 (Q3 2016), git clone --progress will be more verbose.

    See commit 38e590e by Jeff King (peff)
    (Merged by Junio C Hamano in commit a58a8e3 Aug. 4th 2016)

    clone: use a real progress meter for connectivity check

    Because the initial connectivity check for a cloned
    repository can be slow, 0781aa4 (clone: let the user know
    when check_everything_connected is run, 2013-05-03) added a
    “fake” progress meter; we simply say “Checking connectivity
    when it starts, and “done” at the end, with nothing between.

    Since check_connected() now knows how to do a real progress
    meter, we can drop our fake one and use that one instead.

    You might want to take a look at the folder

    $project/.git/objects/pack
    

    While cloning, there should be a file starting with tmp_pack_. It contains the currently downloading git pack.

    With this information you might be able to eyeball the duration.

    How about git clone --progress ?

    Git Baby is a git and github fan, let's start git clone.