local clone and submodules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Say I have a local repository with several submodules that point at
remote repositories. All submodules are up-to-date.

I want to clone everything to another location on disk, *without
hitting the network to fetch the submodules*. Obviously a simple "git
clone" will work for the superproject, but submodules will be
re-fetched from the remote if I pass --recurse-submodules.

Is there any way to do this offline? Reading through the
documentation, it doesn't seem easy, but perhaps it is possible to do
by recursing through the submodules manually.

In Homebrew, we allow building packages directly from a project's
source repository. Currently, the repositories are downloaded into a
local cache, then checked out into a build directory using "git
checkout-index" and "git submodule foreach". However, some projects
require access to the git repository to do things like compute a
version string.

We experimented with using GIT_DIR, but sometimes we are operating on
multiple git repositories, and saving and restoring its value in the
right places is tedious and error prone.

Our current solution is to symlink the .git directory into the build
directory, but I'd like to replace this manual checkout + symlink with
something cleaner. I could just copy the entire repository from the
cache into the build directory, but we deal with some fairly large
repositories so I would prefer to be able to use "git clone" or "git
clone --shared".

Thanks for any suggestions,
Jack
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]