# FEATURE/QUESTION: git fetch only commit objects, but not tree/file objects

2 messages from 2024-11-29 to 2024-12-01. Participants: Antonio Russo, Junio C Hamano.
Thread: https://gitlist.dev/t/62568

## Antonio Russo, 2024-11-29 16:24

Subject: FEATURE/QUESTION: git fetch only commit objects, but not tree/file objects
Message-ID: <c99248d4-777f-461b-b4ab-4cc8df3f09a3@aerusso.net>
URL: https://gitlist.dev/e/c99248d4-777f-461b-b4ab-4cc8df3f09a3%40aerusso.net

```
Hello everyone,

Sometimes I'd like to investigate the commit history of a (large) git repository,
but I don't actually (yet) care about the actual files in the repository. I know
about shallow clones, but it covers kind of the opposite problem: a person may
just want the files, but not the history.

1. Is there a way to download only the git commit objects, and not the
corresponding tree (or file) blobs?

2. Is this a use case that anyone else cares about?  I suppose a ton of code
assumes it can follow any references, so implementing this as a feature means a
ton of code would need to be adapted to handle the reference-not-locally-present
case.  Maybe it might be interesting, but would make the git code-base way too
complicated?

I don't really know what keywords to look for, and man git-fetch did not
superficially seem to answer this, so I apologize if I wasn't able to find this
feature in the documentation.

Best,
Antonio

```

## Junio C Hamano, 2024-12-01 02:36

Subject: Re: FEATURE/QUESTION: git fetch only commit objects, but not tree/file objects
Message-ID: <xmqq8qt0m8o8.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqq8qt0m8o8.fsf%40gitster.g
In-Reply-To: <c99248d4-777f-461b-b4ab-4cc8df3f09a3@aerusso.net>

```
Antonio Russo <aerusso@aerusso.net> writes:

> I don't really know what keywords to look for, and man git-fetch did not

You probably want to look for "--filter" in "git help clone".



```
