- First, we'll check the repository for unpacked objects; we can do this with the count-objects command:
$ git count-objects
51 objects, 204 kilobytes
- We'll also check for unreachable objects, which are objects that can't be reached from any reference (tag, branch, or other object). The unreachable objects will be deleted when the garbage collection runs. We also check the size of the .git directory using the following command:
$ git fsck --unreachable
Checking object directories: 100% (256/256), done.
$ du -sh .git
292K .git # Linux - 1K = 1024 bytes300K .git # MacOS - 1K = 1000 bytes
- There are no unreachable objects. This is because we just cloned and haven't actually worked in the repository. If we delete the origin ...