# How to mirror a directory of a repo?

2 messages from 2021-04-02 to 2021-04-02. Participants: Peng Yu, brian m. carlson.
Thread: https://gitlist.dev/t/55423

## Peng Yu, 2021-04-02 00:49

Subject: How to mirror a directory of a repo?
Message-ID: <CABrM6wkbvC4AvFnbirtRDAr0VBPaueoSP2PEr0W89evG3sPqAQ@mail.gmail.com>
URL: https://gitlist.dev/e/CABrM6wkbvC4AvFnbirtRDAr0VBPaueoSP2PEr0W89evG3sPqAQ%40mail.gmail.com
In-Reply-To: <CAEV-rjfAW56702Vkj-AiXA2WVqFnMjh0Ox-jyv3E1P570GdX_A@mail.gmail.com>

```
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.

-- 
Regards,
Peng

```

## brian m. carlson, 2021-04-02 02:11

Subject: Re: How to mirror a directory of a repo?
Message-ID: <YGZ9OOf+cr5JvMwv@camp.crustytoothpaste.net>
URL: https://gitlist.dev/e/YGZ9OOf%2Bcr5JvMwv%40camp.crustytoothpaste.net
In-Reply-To: <CABrM6wkbvC4AvFnbirtRDAr0VBPaueoSP2PEr0W89evG3sPqAQ@mail.gmail.com>

```
On 2021-04-02 at 00:49:50, Peng Yu wrote:
> 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

```
