Re: why is my repo size ten times bigger than what I expected?
- From
Ruben Laguna <ruben.laguna@gmail.com>
- Date
- Mar 5, 2011, 11:41 UTC
- Message-ID
- <AANLkTinwHMULqPZSguYtJztuA4Oy6-s6Ah3_tcVVO7D9@mail.gmail.com>
- In-Reply-To
- <AANLkTimp8B5Lv15qhGOwOzh+kqOS0g3Xwvgib8vyk+m+@mail.gmail.com>
well, the git-remove-history script does
rm -rf .git/refs/original/ git reflog expire --expire=now --all git fsck --unreachable git gc --prune=now git gc --aggressive --prune=now
after filter-branch so I don't think it's that.
also cloning the repo doesn't change a thing
$ git clone en4j en4j_xx Cloning into en4j_xx... done. $ cd en4j_xx $ du -sh .git 87M .git
any other idea?
On Sat, Mar 5, 2011 at 11:49 AM, Jonathan del Strother <maillist@steelskies.com> wrote:
Show 45 quoted lines
> On 5 March 2011 10:05, Ruben Laguna <ruben.laguna@gmail.com> wrote: >> Hi, >> >> I had a repo which was big 143MB because it contained a bunch of jar >> files. So I decided to remove those completely from the history. >> >> In short I used the git-large-blob [1] to find all the jars and used >> the git-remove-history script [2] which does the filter-branch thing, >> prune, etc. >> >> I did this on all branches (that I know of) and now I can see that the >> jars are gone because I can't find them with git-large-blob. and the >> repo size has dropped from 143Mb to 87Mb. >> >> My concern is that 87Mb is still really big taking into account he >> size of the project. in fact if I run "git diff-tree -r -p $commit >> |wc -c" for each commit and sum all I get 5.5Mb. >> >> >> I also ran the git-rev-size [3] script that I found in this mailing >> list and I only see that the size grows steadly from commit to commit >> up to 1482731 bytes. So again how come the .git directory is 87MB? >> >> >> So, Can anybody tell me if this repository size is "normal" for a >> project with 1.4MB source and 352 commits? >> Is there a better way to calculate the size (in bytes) of each commit? >> >> Is there any other thing I could do to reduce and audit the repository size? >> >> >> Thanks in advance! >> Rubén >> >> --- >> [1] http://stackoverflow.com/questions/298314/find-files-in-git-repo-over-x-megabytes-that-dont-exist-in-head >> [2] http://dound.com/2009/04/git-forever-remove-files-or-folders-from-history/ >> [3] http://markmail.org/message/762zzg5zckbiq2i7 > > What happens if you clone that repo? > git-gc will only pruned unused objects that're older than 2 weeks by > default, so it's possible that your repo size will suddenly shrink in > 2 weeks time (or sooner, if you run git-gc with the appropriate > options) >
-- /Rubén