Thread (12 messages) flat view 12 messages, 6 authors, 2016-06-15

Re: Local clones aka forks disk size optimization

From: Andrew Ardill <hidden>
Date: 2016-06-15 22:55:17

On 15 November 2012 10:42, Javier Domingo [off-list ref] wrote:
Hi,

I have come up with this while doing some local forks for work.
Currently, when you clone a repo using a path (not file:/// protocol)
you get all the common objects linked.

But as you work, each one will continue growing on its way, although
they may have common objects.

Is there any way to avoid this? I mean, can something be done in git,
that it checks for (when pulling) the same objects in the other forks?
Have you seen alternates? From [1]:
How to share objects between existing repositories?
---------------------------------------------------------------------------

Do

echo "/source/git/project/.git/objects/" > .git/objects/info/alternates

and then follow it up with

git repack -a -d -l

where the '-l' means that it will only put local objects in the pack-file
(strictly speaking, it will put any loose objects from the alternate tree
too, so you'll have a fully packed archive, but it won't duplicate objects
that are already packed in the alternate tree).
[1] https://git.wiki.kernel.org/index.php/GitFaq#How_to_share_objects_between_existing_repositories.3F


Regards,

Andrew Ardill
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help