Can you apply a filter to Git Fetch?

Viewed 392

I know that git clone now has a --filter option that allows you to filter out blob objects so that you get the commit and tree objects that define the structure of the directory tree without getting the file contents themselves.

But is there a way you can do the same for git fetch? I'd like to get a list of all the filenames and their individual SHA1s for a commit on a remote server, without having to download all the files themselves.

1 Answers

Use the same --filter options. When git clone clones a repository, it's using the git fetch code to do it. For some reason these are not documented under the git fetch documentation, but they are still supported.

Related