Git clone bare repo without blobs

我只是一个虾纸丫 提交于 2019-12-01 11:03:54

Is there something like git fast-export --no-data which I can use on the client-side?

No: beside git ls-remote (which gets metadata only for the heads of the remote repo), anything else would get the full repo history.

You would need your repo managed by a Git hosting service, like GitHub, providing an API (like the commits API), in order to query metadata without data.

Another Idea for this some time later: As of 2017, the pack-protocol now allows partial clones, and there is a --filter=blob:none available that omits all blobs -- which should be sufficient on the server-side.

Given the current server-side implementation, sadly, this doesn't work as well as one would hope:

C:\Users\phi1010>git clone https://github.com/torvalds/linux.git --filter=blob:none
Cloning into 'linux'...
warning: filtering not recognized by server, ignoring
remote: Enumerating objects: 6876195, done.
[...]

Github even announced the support of the v2 protocol and its filtering capabilities, but this neither works with -c protocol.version=2, as also stated on Do GitHub and GitLab support git clone's --filter parameter?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!