15

When doing a git clone of a repo over SSH or HTTP, you get output that looks something like this:

Cloning into 'some_directory'...
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 7 (delta 0), reused 5 (delta 0), pack-reused 0
Unpacking objects: 100% (7/7), done.
Checking connectivity... done.

I'm interested in that last "Checking connectivity" step. It happens after the repo and all of its metadata has been downloaded, i.e. well after any internet connectivity has finished.

What exactly is this step of the process accomplishing?

2
  • 1
    Have you noticed the Checking out files: 100% (2897/2897), done. after Checking connectivity? It seems that Receiving objects doesn't actually mean receiving the content. For example, when I cloned git, I got this line of output: Receiving objects: 100% (199562/199562), 84.06 MiB | 3.90 MiB/s, done.. However, when I downloaded a zip from GitHub, the decompressed directory was only 28 MiB. I'm not sure what this means, but it might be the summary of all the past commits or something like that.
    – ecube
    Commented Mar 18, 2016 at 2:03
  • 1
    @ecube: Cloning a git repository constitutes making a local copy of its entire history, including every branch, commit, and revision. The ZIP file provided by Github is not a git repository, but rather a snapshot of the latest revision of the repository on the primary branch. The latter will of course always be smaller. Commented Sep 6, 2016 at 15:14

1 Answer 1

20

I think the word connectivity has nothing to do with network connectivity here. The message is displayed after all data were already received from git server.

One can find some clues in git sources. There is following comment in connected.c file:

/*
 * If we feed all the commits we want to verify to this command
 *
 *  $ git rev-list --objects --stdin --not --all
 *
 * and if it does not error out, that means everything reachable from
 * these commits locally exists and is connected to our existing refs.
 * Note that this does _not_ validate the individual objects.
 *
 * Returns 0 if everything is connected, non-zero otherwise.
 */

It is related to function check_everything_connected_real that is called after Checking connectivity... message is displayed.

So it basically means that git is checking whether all objects were received correctly (are connected to existing refs).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .