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

Re: Is it possible to git clone --filter= without any objects?

From
Stefan Beller <sbeller@google.com>
Date
Sep 11, 2018, 17:15 UTC
Message-ID
<CAGZ79kYK7ish4_DaZN2bCfZz7LNAjxogQH1k6T=hFcxxkXzJQw@mail.gmail.com>
In-Reply-To
<CAFXrp_fLwL5=K3B5rWjY+imoqtskT8LG-UH8ec3CPwM0iiSzFg@mail.gmail.com>
On Tue, Sep 11, 2018 at 12:29 AM Ciro Santilli <ciro.santilli@gmail.com> wrote:
Show 21 quoted lines
>
> At v2.19.0 I was trying to clone a fetch just a single directory:
> https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository/52269934#52269934
>
> I got really close with:
>
> git clone --depth 1 --no-checkout --filter=blob:none \
>   "file://$(pwd)/server_repo" local_repo
> cd local_repo
> git checkout master -- mydir/
>
> The only missing thing is that uneeded tree objects are still being fetched.
>
> If I had a:
>
> git clone --filter=none
>
> for example then that would be done.
>
> Nothing major since those are small, but just looking for the perfect
> command :-)

You might be pleased to hear about a series floating on the mailing list, that started at https://public-inbox.org/git/cover.1533854545.git.matvore@google.com/ and promised to filter trees away, and its latest version can be found at https://public-inbox.org/git/cover.1536081438.git.matvore@google.com/

Thanks, Stefan

Previous: Ciro SantilliNext: Jonathan Tan
Message 2 of 6 in “Is it possible to git clone --filter= without any objects?”
  1. Ciro SantilliSep 11, 2018
  2. Stefan BellerSep 11, 2018
  3. Jonathan TanSep 11, 2018
  4. Junio C HamanoSep 11, 2018
  5. Ciro SantilliSep 11, 2018
  6. Matthew DeVoreSep 12, 2018

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.