git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [QUESTION] Selective fetch possible?

From
Shawn O. Pearce <spearce@spearce.org>
Date
Mar 10, 2008, 22:53 UTC
Message-ID
<20080310225302.GE8410@spearce.org>
In-Reply-To
<47D5AFF3.90000@yahoo.it>
Filippo Zangheri <filippo.zangheri@yahoo.it> wrote:
Show 5 quoted lines
> 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.
 
-- 
Shawn.
Previous: Filippo ZangheriNext: Jakub Narebski
Message 2 of 7 in “[QUESTION] Selective fetch possible?”
  1. Filippo ZangheriMar 10, 2008
  2. Shawn O. PearceMar 10, 2008
  3. Jakub NarebskiMar 10, 2008
  4. Rogan DawesMar 11, 2008
  5. Shawn O. PearceMar 11, 2008
  6. Rogan DawesMar 11, 2008
  7. Filippo ZangheriMar 11, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.