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

Re: How to mirror a directory of a repo?

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Apr 2, 2021, 02:11 UTC
Message-ID
<YGZ9OOf+cr5JvMwv@camp.crustytoothpaste.net>
In-Reply-To
<CABrM6wkbvC4AvFnbirtRDAr0VBPaueoSP2PEr0W89evG3sPqAQ@mail.gmail.com>
On 2021-04-02 at 00:49:50, Peng Yu wrote:
Show 10 quoted lines
> https://github.com/bayandin/chromedriver
> 
> It seems that the above repo is a mirror of one particular
> subdirectory of the main chromium repository
> https://chromium.googlesource.com/chromium/src/
> 
> https://chromium.googlesource.com/chromium/src/+/master/chrome/test/chromedriver/
> 
> I don't know how a repo can be partially cloned. Could anybody let me
> know how this is done? Thanks.

There isn't a way to clone just a single directory of a repository. The protocol doesn't consider that, and even if you could get such a clone to happen, it would be considered corrupt and a lot of things would be broken. Partial clone can be used to do something similar, but not completely the same. In such a case, you download stub objects that are filled in by a connection to the server on demand.

What is most likely to have happened is that someone took a script that extracts the commits that touch a particular directory and created a new, entirely different repository and synthesized commits there with the same commit metadata. The two repositories are likely completely independent in terms of histories.

Sorry there isn't a magic cool explanation for what's going on here, but it really is essentially a copy-and-paste into a different repo.

-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US
Previous: Peng Yu
Message 2 of 2 in “How to mirror a directory of a repo?”
  1. Peng YuApr 2, 2021
  2. brian m. carlsonApr 2, 2021

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.