Find size of Git repository


What's a simple way to find the size of my Git repository?

And I don't mean du -h on the root directory of my repository. I have a lot of ignored files, so that size would be different from my total repository size. I essentially want to know how much data would be transferred upon cloning my repository.


Note that, since git 1.8.3 (April, 22d 2013):

"git count-objects" learned "--human-readable" aka "-H" option to show various large numbers in Ki/Mi/GiB scaled as necessary.

That could be combined with the -v option mentioned by Jack Morrison in his answer.

git gc
git count-objects -vH

(git gc is important, as mentioned by A-B-B's answer)

Plus (still git 1.8.3), the output is more complete:

"git count-objects -v" learned to report leftover temporary packfiles and other garbage in the object store.

Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch

Finding a branch point with Git?