LinuxCommandLibrary

git-count-objects

Report repository object counts and sizes

TLDR

Count objects

$ git count-objects
copy
Verbose count
$ git count-objects -v
copy
Human readable sizes
$ git count-objects -vH
copy

SYNOPSIS

git count-objects [options]

DESCRIPTION

git count-objects reports the number of unpacked objects and their disk consumption. It helps understand repository size and identify when garbage collection might be beneficial.
The verbose mode (-v) shows packed objects, prunable objects, and size breakdowns including pack file count and total size. This information helps diagnose repository bloat and determine when git gc should be run.
The -H flag presents sizes in human-readable format (KB, MB, GB), making it easier to assess storage at a glance without manual unit conversion.

PARAMETERS

-v, --verbose

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

CAVEATS

Core git command. Unpacked objects indicate recent activity. Large counts may indicate need for gc.

HISTORY

git count-objects is a core Git command for repository maintenance, helping administrators understand storage usage.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community