On Fri, 3 Oct 2014 04:53:54 -0700 (PDT) Alcolo Alcolo <[email protected]> wrote:
> Because I want to handle a lot of projects with there own life cycle: > I project to use git submodules. > > Each projects/submodules have very a similar contents: then a lot of > git objects are identical between submodules. > I can see duplications with: > > find .git/modules/ -type d -name objects | while read D; do (cd "$D"; > find . -type f); done | sort | uniq -d -c > > There is a way to merge submodules object directories ? > I think about a mecanism like git clone --shared. `git submodule` supports the "--reference <repo>" command-line option which does the same --shared and --reference do for `git clone`, so yes, what you want appears to be doable. Setting up alternatives is also supposedly doable with submodules after they are brought in, though manually [1]. Make sure you have read carefully the section on --shared in the `git clone` manual page. Note that `git clone` supports another way of sharing, which is less fragile but has a restriction that both source and resulting repositories must reside on the same filesystem: if you use a bare pathname (w/o the "file://" URI scheme) when cloning, Git hardlinks as much as possible instead of transferring objects and later ensures to properly use write()+rename() to not clobber files with multiple references. Supposedly this also works for submodules but the same restriction applies: their source repos must be on the same filesystem as destination and bare pathnames must be used as URIs. 1. https://git.wiki.kernel.org/index.php/Git_FAQ#How_to_share_objects_between_existing_repositories.3F -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
