← 返回命令列表

Linux command

git-count-objects 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Count objects

git count-objects

Verbose count

git count-objects -v

Human readable sizes

git count-objects -vH

说明

git count-objects reports the number of unpacked object files and their disk consumption, to help decide when it is a good time to repack. The verbose mode (-v) shows a detailed breakdown: count (loose objects), size (disk space of loose objects in KiB), in-pack (number of packed objects), packs (number of pack files), size-pack (disk space of packs in KiB), prune-packable (loose objects also present in packs), and garbage (files in the object directory that are neither valid loose objects nor valid packs). The -H flag presents sizes in human-readable format (KiB, MiB, GiB), making it easier to assess storage at a glance without manual unit conversion.

参数

-v, --verbose
Show detailed breakdown.
-H, --human-readable
Human-readable sizes.
--help
Display help information.

FAQ

What is the git-count-objects command used for?

git count-objects reports the number of unpacked object files and their disk consumption, to help decide when it is a good time to repack. The verbose mode (-v) shows a detailed breakdown: count (loose objects), size (disk space of loose objects in KiB), in-pack (number of packed objects), packs (number of pack files), size-pack (disk space of packs in KiB), prune-packable (loose objects also present in packs), and garbage (files in the object directory that are neither valid loose objects nor valid packs). The -H flag presents sizes in human-readable format (KiB, MiB, GiB), making it easier to assess storage at a glance without manual unit conversion.

How do I run a basic git-count-objects example?

Run `git count-objects` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -v, --verbose do in git-count-objects?

Show detailed breakdown.