4 ms·
Interesting! I didn't know about the --remote flag and this usage. I would probably have done something like: git clone --filter=tree:0 --depth=1 --sparse --no
by matheust 3y ago
Interesting! I didn't know about the --remote flag and this usage. I would probably have done something like:
git clone --filter=tree:0 --depth=1 --sparse --no-checkout &&
git checkout HEAD <desired_file>
(But that would still end up fetching a few more objects than just the desired file.)
- eru 3y agoThe other comment above would probably also need to transmit a few more objects. At least if you are starting from a commit hash (instead of HEAD) and don't trust the server. (I would assume git doesn't trust the server, and will verify that the chain of hashes works out.)