问题描述
寻找我的git仓库大小的简单方法是什么?我的意思是我的回购根目录上没有 du -h
。我有很多被忽略的文件,因此大小会与我的总回购大小不同。我本质上想知道在克隆我的回购库时将传输多少数据。
对于完整尺寸的不同想法,您可以使用:
git bundle create tmp.bundle --all
du -shmp.bundle
关闭(但不是确切的):
git gc
du -sh .git /
对于后者,您还可以计算:
详细信息等)
$ reflogs
状态从rebase, bisect等)。
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.
For different ideas of "complete size" you could use:
git bundle create tmp.bundle --all
du -sh tmp.bundle
Close (but not exact:)
git gc
du -sh .git/
With the latter, you would also be counting:
- hooks
- config (remotes, push branches, settings (whitespace, merge, aliases, userdetails etc.)
- stashes (see Can I fetch a stash from a remote repo into a local branch? also)
- rerere cache (which can get considerable)
- reflogs
- backups (from filter-branch, e.g.) and various other things (intermediatestate from rebase, bisect etc.)
这篇关于查找git回购的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!