You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

带--shortstat的git log在精简裸克隆仓库中拉取远程对象的问题

问题:裸仓库执行git log --shortstat时自动拉取远程对象

我在自动化系统中需要克隆指定仓库为裸仓库以解析提交,使用的克隆命令为:

git clone https://github.com/google/material-design-icons.git --filter=blob:none --bare --no-tags --single-branch

该命令能实现最小磁盘占用与快速克隆,符合需求。

但执行以下git log命令时,Git会在提交解析过程中暂停并拉取远程对象:

git --no-pager log --max-count=10000 --shortstat -z

对应的输出信息如下:

remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 8 (delta 2), reused 8 (delta 2), pack-reused 0
Receiving objects: 100% (8/8), 13.48 MiB | 5.76 MiB/s, done.
Resolving deltas: 100% (2/2), done.

移除--shortstat参数后,该问题消失。

我查阅Git文档未找到原因,希望能在保持精简克隆的前提下,输出提交统计信息且无需拉取远程对象。


内容的提问来源于stack exchange,提问作者shellscape

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.10 02:20:27