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 repo. I have a lot of ignored files so that size would be different from my total repo size. I essentially want to know how much data would be transfered upon cloning my repo.
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
Note that, since git 1.8.3 (April, 22d 2013):
That could be combined with the
-v
option mentioned by Jack Morrison in his answer.(
git gc
is important, as mentioned by A-B-B's answer)Plus (still git 1.8.3), the output is more complete:
For different ideas of "complete size" you could use:
Close (but not exact:)
With the latter, you would also be counting:
The git command
will give you a good estimate of the git repository's size. Without the -v flag, it only tells you the size of your unpacked files. This command may not be in your $PATH, you may have to track it down (on Ubuntu I found it in /usr/lib/git-core/, for instance).
From the Git man-page:
Your output will look similar to the following:
The line you're looking for is
size-pack
. That is the size of all the packed commit objects, or the smallest possible size for the new cloned repository.You could use
git-sizer
. In the--verbose
setting, the example output is (below). Look for theTotal size of files
line.If you use git LFS, git count-objects does not count your binaries, but only the pointers to them.
If your LFS files are managed by Artifactorys, you should use the REST API: