# Average size of git bookkeeping data (related to Using git as a general backup mechanism)

3 messages from 2006-12-13 to 2006-12-20. Participants: David Tweed, David Lang, Johannes Schindelin.
Thread: https://gitlist.dev/t/43124

## David Tweed, 2006-12-13 19:31

Subject: Average size of git bookkeeping data (related to Using git as a general backup mechanism)
Message-ID: <20061213193149.43284.qmail@web86909.mail.ukl.yahoo.com>
URL: https://gitlist.dev/e/20061213193149.43284.qmail%40web86909.mail.ukl.yahoo.com

```
Hi,
This is in connection with the "Using git as a general backup mechanism" thread,
but on a different slant more along automatic versioning a subset of the files on the disc (to avoid
sucking in things like core files and particularly huge multimedia files). In this case I don't
want to discard old "backups" but just grow the chronological database. (Think a more selective version of
Plan 9's venti filesystem.)

How big is the "metadata" or "bookeeping data" in git related to a commit? (Eg, "around x bytes per changed file"
or "around x bytes per file being tracked (whether changed in the commit or not)" )

[I'm trying to get a feel for, if I switched to git, how much overhead would come from having a cron job automatically doing
a snapshot every hour (if anything has changed), plus manual snapshots at points where I want to feel "safeguarded".
I'm currently using my own simple, hacked together system for combined versioning/backups that does
this. Using naive tools that don't account for wastes space due to disk block size effects the data being
tracked is currently just under 9 months of acitvity on  2016 filenames with
17457599 bytes of data (ie, compressed version of their contents at various times) and 7838546 bytes
is "metadata", ie, 30 percent of the stored data is metadata. This is in a format using 6 bytes to associate a single blob of
contents to a filename (whether changed since last snapshot or not).]

Many thanks for any insight,

cheers, dave tweed




```

## Johannes Schindelin, 2006-12-14 00:02

Subject: Re: Average size of git bookkeeping data (related to Using git as a general backup mechanism)
Message-ID: <Pine.LNX.4.63.0612140058000.3635@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0612140058000.3635%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <20061213193149.43284.qmail@web86909.mail.ukl.yahoo.com>

```
Hi,

On Wed, 13 Dec 2006, David Tweed wrote:

> How big is the "metadata" or "bookeeping data" in git related to a 
> commit?

In my experience, a single commit (with the trees and blobs being 
reachable from it) takes about the same space in a pack as the 
corresponding tar ball.

When you add revisions, the pack grows approximately with the compressed 
patch size.

So, if you can estimate the size of the initial tar ball and the size of 
the subsequent patches, you have a ballpark figure of the metadata size of 
the git repository. (This is for the bare case; for the regular case you 
have to add the size of a checked out tree, of course.)

Hth,
Dscho

```

## David Lang, 2006-12-20 01:20

Subject: Re: Average size of git bookkeeping data (related to Using git as a general backup mechanism)
Message-ID: <Pine.LNX.4.63.0612191712440.18007@qynat.qvtvafvgr.pbz>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0612191712440.18007%40qynat.qvtvafvgr.pbz
In-Reply-To: <20061213193149.43284.qmail@web86909.mail.ukl.yahoo.com>

```
On Wed, 13 Dec 2006, David Tweed wrote:

> How big is the "metadata" or "bookeeping data" in git related to a commit? (Eg, "around x bytes per changed file"
> or "around x bytes per file being tracked (whether changed in the commit or not)" )
>
> [I'm trying to get a feel for, if I switched to git, how much overhead would come from having a cron job automatically doing
> a snapshot every hour (if anything has changed), plus manual snapshots at points where I want to feel "safeguarded".
> I'm currently using my own simple, hacked together system for combined versioning/backups that does
> this. Using naive tools that don't account for wastes space due to disk block size effects the data being
> tracked is currently just under 9 months of acitvity on  2016 filenames with
> 17457599 bytes of data (ie, compressed version of their contents at various times) and 7838546 bytes
> is "metadata", ie, 30 percent of the stored data is metadata. This is in a format using 6 bytes to associate a single blob of
> contents to a filename (whether changed since last snapshot or not).]

if nothing has changed it will take the space of the commit tag, as the tree 
will remain the same (and you should be able to script detection of this case 
and make it zero overhead)

if something has changed you will have the new tree and the changed object

in a tree each object is ~28 bytes (IIRC from what Linus mentioned in the last 
week or two)

a loose object is compressed, and if you repack it will delta against prior 
versions for even more space savings

look at the size of the mozilla tree and the kernel tree and you will see that 
when packed git is about as efficiant as any other option you have (and more 
efficiant than most)


```
