![Git clone“检查连接性”-它是什么?](https://linux22.com/image/1486999/Git%20clone%E2%80%9C%E6%A3%80%E6%9F%A5%E8%BF%9E%E6%8E%A5%E6%80%A7%E2%80%9D-%E5%AE%83%E6%98%AF%E4%BB%80%E4%B9%88%EF%BC%9F.png)
当git clone
通过 SSH 或 HTTP 执行 repo 时,您会得到类似这样的输出:
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.
我对最后一个“检查连接”步骤很感兴趣。后该仓库及其所有元数据都已下载,即在任何互联网连接完成后。
此过程步骤究竟要完成什么?
答案1
我认为这个词connectivity
与网络连接无关。从 git 服务器接收到所有数据后,将显示该消息。
你可以在 git 源代码中找到一些线索。已连接.c文件:
/*
* 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.
*/
它与消息发送check_everything_connected_real
后调用的函数相关Checking connectivity...
显示。
所以它基本上意味着 git 正在检查所有对象是否被正确接收(是否连接到现有的引用)。