I am trying to clone a repository with a lot of blobs in its history, and would like to only download the files at a specific commit without any added overhead or redundancy.
When trying git clone --depth 1
, the .git
directory becomes quite large. This appears to be because of a large packfile, whose file size corresponds to the size reported by git when it is Receiving objects:
. Inspecting the packfile with git verify-pack
suggests it contains a large amount of blob information.
However, trying git clone --filter=blob:none
still results in a similarly large packfile listing blobs.
My expectation would be that --depth 1
shouldn’t be downloading any history, and filter=blob:none
shouldn’t be downloading any blob history.
So why is my .git
directory being populated with packfile overhead for a shallow clone?
I am wondering if this is perhaps the initial compressed download of the single commit I checked out – but even so, how can I prevent this redundant file from persisting?
For specific reference, the repository I am cloning is ARM-software/CMSIS_5.
This started out as a question about shallow submodules and only downloading files at a specific commit without overhead, but the packfile overhead appears to pertain to cloning in general so I figured I’d start here.
recursivenomad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.