Git 克隆详细模式——显示每个传入的对象
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17599999/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git clone verbose mode – show each incoming object
提问by erkfel
I'm wondering that git clone --verbose
is not very verbose. The output of executing the command is the following:
我想知道这git clone --verbose
不是很冗长。执行命令的输出如下:
$ git clone --verbose <repo>
remote: Counting objects: 184, done
remote: Finding sources: 100% (184/184)
remote: Total 184 (delta 66), reused 183 (delta 66)
Receiving objects: 100% (184/184), 18.90 KiB, done.
Resolving deltas: 100% (66/66), done.
The expected behaviour is to see the list of the received objects one by one. Is that possible using some other options?
预期的行为是一一查看接收到的对象列表。可以使用其他一些选项吗?
采纳答案by Lekensteyn
It is not possible to list objects (files, commits, blobs, whatever) one-by-one, simply because git packs them in a single file for efficiency reasons. For the same reason, you will only see a hidden .git
folder while cloning, files will be created only if the full pack file has been downloaded.
不可能一个一个地列出对象(文件、提交、blob 等等),仅仅是因为 git 出于效率原因将它们打包在一个文件中。出于同样的原因,您.git
在克隆时只会看到一个隐藏文件夹,只有在下载完整包文件后才会创建文件。
If you are wondering, these pack files will be downloaded to .git/objects/pack/
with a name like tmp_pack_XXXXXX
. (later on, it will be renamed to something like pack-*.pack
with a related pack-*.idx
file)
如果您想知道,这些包文件将被下载到.git/objects/pack/
类似tmp_pack_XXXXXX
. (稍后,它将被重命名为pack-*.pack
与相关pack-*.idx
文件类似的内容)
回答by Nayagam
I accept @Lekensteyn answer.
我接受@Lekensteyn 的回答。
If you want to trace git remote commands,add following environmental variables into your terminal.This helps you to peek into what is running behind the scenes of a git command.
如果您想跟踪 git 远程命令,请将以下环境变量添加到您的终端中。这有助于您查看 git 命令幕后运行的内容。
export GIT_TRACE_PACKET=1
export GIT_TRACE=1
export GIT_CURL_VERBOSE=1
Reference:https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables
参考:https: //git-scm.com/book/en/v2/Git-Internals-Environment-Variables