git 停留在解包对象阶段
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7731785/
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 stuck on Unpacking Objects phase
提问by gadgad
I'm trying to do a git pull
from a remote repository in github into a local machine...
but git gets stuck on 70% into the "Unpacking objects" phase, with no sign of going anywhere.. (left it for several hours now with no change)
我正在尝试git pull
从 github 中的远程存储库执行到本地机器......但是 git 卡在 70% 进入“解包对象”阶段,没有任何去任何地方的迹象..(现在离开了几个小时没有变化)
Any suggestion on how to fix this issue?
有关如何解决此问题的任何建议?
Is it possible to instruct git to only download the latest commit/version from the remote repository without all the Intermediate states?
是否可以指示 git 只从远程存储库下载最新的提交/版本而没有所有中间状态?
回答by Ernest
I had the same problem when I git pull a repository on github.com. I found there were some large files and the connection to github was slow. So maybe you just have to wait patiently before git pulls the whole repository.
当我在 github.com 上 git pull 一个存储库时,我遇到了同样的问题。我发现有一些大文件,与 github 的连接很慢。所以也许你只需要耐心等待 git 拉取整个存储库。
回答by Al Lelopath
For me the solution was to change protocol specifier from https to git, e.g.:git clone https://github.com/some/repository
togit clone git://github.com/some/repository
对我来说,解决办法是从https更改协议说明与git,如:git clone https://github.com/some/repository
对git clone git://github.com/some/repository
Edit:
Here's something about the protocols used in Git.
Some highlights:
The downside of the Git protocol is the lack of authentication.
It also requires firewall access to port 9418, which isn't a standard port that corporate firewalls always allow
编辑:
这是关于 Git 中使用的协议的一些内容。
一些亮点:
Git 协议的缺点是缺乏身份验证。
它还需要防火墙访问端口 9418,这不是企业防火墙始终允许的标准端口
回答by Evan Stone
I find that large binary objects (like Adobe Illustrator files, etc.) tend to bog the whole pull/push process down as well.
我发现大型二进制对象(如 Adobe Illustrator 文件等)也会使整个拉/推过程陷入困境。
Which is why I like to use two repositories now for design vs. code.
这就是为什么我现在喜欢使用两个存储库来进行设计与代码。
回答by VonC
[...] but git gets stuck on 70% into the "
Unpacking objects
" phase, with no sign of going anywhere
[...] 但是 git 卡在 70% 进入“
Unpacking objects
”阶段,没有任何进展的迹象
With Git 2.25 (Q1 2020), "git unpack-objects
" used to show progress based only on the number of received and unpacked objects, which stalled when it has to handle an unusually large object.
在 Git 2.25(2020 年第 1 季度)中,“ git unpack-objects
”过去仅根据接收和解包对象的数量显示进度,当它必须处理异常大的对象时会停止。
It now shows the throughput as well.
它现在也显示吞吐量。
See commit bae60ba(19 Nov 2019) by SZEDER Gábor (szeder
).
(Merged by Junio C Hamano -- gitster
--in commit cf91c31, 05 Dec 2019)
请参阅SZEDER Gábor ( )提交的 bae60ba(2019 年 11 月 19 日)。(由Junio C Hamano合并-- --在提交 cf91c31 中,2019 年 12 月 5 日)szeder
gitster
builtin/unpack-objects.c
: show throughput progressSigned-off-by: SZEDER Gábor
'git unpack-objects' shows a progress line only counting the number of unpacked objects, so if some of the received objects are unusually large, then that progress might appear to be frozen while processing such a larger object.
I just stared at a seemingly stuck progress line for over half a minute, while '
git fetch
' was busy receiving a pack with only a couple of objects (i.e. fewer than 'fetch.unpackLimit
'), with one of them being over 80MB.Display throughput in '
git unpack-objects
' progress line, so we show that something is going on even when receiving and processing a large object.Counting the consumed bytes is far away from the place that counts objects and displays progress, and to pass around the '
struct progress
' instance we would have to modify the signature of five functions and 14 of their callsites: this is just too much churn, so let's rather make it file-scope static.'
git index-pack
', i.e. the non-unpacking cousin of 'git unpack-objects
' already includes throughput in its progress line, and it uses a file-scope static 'struct progress
' instance as well.
builtin/unpack-objects.c
: 显示吞吐量进度签字人:SZEDER Gábor
'git unpack-objects' 显示的进度行只计算解包对象的数量,因此如果接收到的某些对象异常大,那么在处理如此大的对象时,该进度可能会被冻结。
我只是盯着一条看似卡住的进度线超过半分钟,而“
git fetch
”正忙于接收只有几个对象(即少于“fetch.unpackLimit
”)的包,其中一个超过 80MB。在“
git unpack-objects
”进度行中显示吞吐量,因此我们显示即使在接收和处理大对象时也有一些事情正在发生。计算消耗的字节数与计算对象和显示进度的地方相去甚远,并且要传递 '
struct progress
' 实例,我们必须修改五个函数的签名和它们的 14 个调用点:这实在是太多的改动,所以让我们而是使其文件范围静态。'
git index-pack
',即' ' 的非解包表亲git unpack-objects
已经在其进度行中包含了吞吐量,并且它也使用了文件范围的静态 'struct progress
' 实例。