gitmetadatagit-fetchgit-notes

Git blobless repository


I'm wondering if there's a way to get commit and tree objects only from a remote.

This may sound like a silly question, I'm not sure—I'm new to git plumbing. I'm building an app that associates meta-data with git commits, authorships, and file system structure. My options are to build a cludgy in-database normalization of the data with some sort of hook-enabled syncing mechanism, or to use the powerful native git tools for syncing, attaching metadata, and querying history.

However, since I don't actually need the blob objects, it'd save me a buck or two on hosting if I could shed them somehow. Is this or any incarnation of the concept possible?


Solution

  • Today, git has "partial clone" options that enable downloading the commits and trees of a repository without its blobs. You can do it by passing --filter=blob:none to the git clone command. This does require the remote you are cloning from to have a new enough git version to support the filter protocol.

    See also: