Re: [QUESTION] Selective fetch possible?
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Mar 10, 2008, 23:34 UTC
- Message-ID
- <m3d4q2ywyx.fsf@localhost.localdomain>
- In-Reply-To
- <20080310225302.GE8410@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 20 quoted lines
> Filippo Zangheri <filippo.zangheri@yahoo.it> wrote: > > > > Is it possible to git-fetch only a portion of the tree > > of the specified repository, say, fetch only one directory or a > > subset of files matching some regular expression? This is currently > > - to my knowledge - only possible via wget iff the GIT repository > > has gitweb enabled. But that's just a workaround. > > No. > > You can use a shallow clone to fetch only X commits back into > history on any branch, and you can also manually configure the > fetch specification in .git/config to only fetch specific branches, > but you must fetch the entire tree to get any of the files in it. > > If the repository is available by git:// protocol you may be able > to use git-archive to obtain a tarfile for just the directory you > want (service has to be enabled on the remote side) but that is > just a raw UNIX tar; there is no Git repository and no ability to > commit/fetch/push/diff/apply/log/etc.
Note that what you wanted is, I guess, something called partial checkout or subtree checkout. This feature appears now and then in feature requests; lately Nguyen Thai Ngoc Duy (pclouds) offered to do this in "on subtree checkout" thread: http://thread.gmane.org/gmane.comp.version-control.git/74915
The problem is twofold, as far as I understand it. First, what to do if there is merge conflicts outside checked out (selected) directory? Second, how to make repository contain only relevant objects: git in many places assumes full connectivity, and that if it has an object it hass all objects depending on it.
-- Jakub Narebski Poland ShadeHawk on #git