git_count-objects

How to count objects in the object store.

git count-objects [-v] [-H | --human-readable]

Based on current state of “Pro Git” book repo:

$ git count-objects
718 objects, 3120 kilobytes
$
$ git count-objects -v
count: 718
size: 3120
in-pack: 10966
packs: 6
size-pack: 175419
prune-packable: 45
garbage: 0
size-garbage: 0
$

You can always invoke garbage collection to pack:

$ git gc
Enumerating objects: 11317, done.
Counting objects: 100% (11317/11317), done.
Delta compression using up to 8 threads
Compressing objects: 100% (4606/4606), done.
Writing objects: 100% (11317/11317), done.
Total 11317 (delta 6846), reused 10610 (delta 6370)
$

after which:

$ git count-objects -v
count: 31
size: 128
in-pack: 11317
packs: 1
size-pack: 174725
prune-packable: 0
garbage: 0
size-garbage: 0
$
  • git_count-objects.txt
  • Last modified: 2019/03/01 10:14
  • by rpjday