What I would ask you is: do you really need to share the repository?
Like Mercurial, git creates hard-links between repositories when you make a local clone, resulting in only little extra disk space consumption. E.g.:
git clone http://example.org/repo repo
git clone repo repo-copy1
git clone repo repo-copy2
Most files in the repo-copy1
and repo-copy2
repositories will hard-link to repo
, and will not consume extra disk space. Only the files in the working copy are actual copies.
You can confirm this behaviour like this:
$ df -l
Filesystem 512-blocks Used Available Capacity Mounted on
/dev/disk0s2 976101344 217966872 757622472 23% /
$ git clone --no-checkout repo repo-copy
Cloning into repo-copy...
done.
$ du -cs repo-copy/.git
63528 .
63528 total
$ df -l
Filesystem 512-blocks Used Available Capacity Mounted on
/dev/disk0s2 976101344 217967536 757621808 23% /
As you can see, after cloning a 65880-block repository (of 512 bytes each), the block count on the file system went down by only 664 blocks.
If you clone a (sub)repository from a remote server you may have to manually create the hard links to other local clones; for Mercurial you would use the relink
extension for that; the git equivalent also seems to be called that.