From: Marc Branchaud Date: Tue, 27 Jul 2010 14:24:13 GMT Subject: RFC: Sparse checkout improvements (was: Re: question (possibly) on git subtree/submodules) Message-ID: <4C4EEC0D.2070105@xiplink.com> In-Reply-To: On 10-07-27 08:48 AM, Jakub Narebski wrote: > Alex writes: > >> Chris Packham gmail.com> writes: >> >>> The short answer is no. Nothing git has currently will let you clone a >>> subset of files. >> >> Isn't that what 'sparse checkout' does? >> (http://www.kernel.org/pub/software/scm/git/docs/git-read-tree.html#_sparse_checkout) > > No, 'sparse checkout' is only about checkout, i.e. the working area. > You still have all objects in repository, only part of tree (part of > project / repository) is not checked out, not present on disk as > files. There's no such thing as a "sparse fetch" but you can do something like git clone -n git://there/foo.git cd foo then git checkout origin/ -- or git config core.sparseCheckout true [ Add paths to .git/info/sparse-checkout ] git checkout but it's fairly inconvenient for day-to-day work. Also, putting a .git/info/sparse-checkout file in a public repo seems of limited use. So IMHO the current sparse-checkout feature is pretty bare-bones and could use some meat. Here's some thoughts: * What's missing is a way to define named collections of paths ("sparse-sets?") in .git/info/sparse-checkout, so that you can conveniently checkout a particular subset of the working directory. It would also be nice to switch between different sparse-sets. * It would also be good to have a way for a repo to define a default sparse-set, so that a clone would only checkout that default. * I also think that core.sparseCheckout should be true by default, and git should impose no sparseness if .git/info/sparse-checkout is missing or empty. Comments? M.