Git克隆裸回购没有斑点 [英] Git clone bare repo without blobs

查看:105
本文介绍了Git克隆裸回购没有斑点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的git仓库中,我使用一种算法,根据分支名称和标签,为每个提交分配一个或多个唯一的版本号.我想将此机制与另一个大型存储库一起使用,我想在不传输任何文件的情况下进行克隆.

On my git repository, I use an algorithm to assign every commit one or more unique version numbers, based on branch names and tags. I want to use this mechanism with another large repository, that I would like to clone without transferring any files.

一个简单的克隆可以帮助我摆脱Blob的工作副本,但仍会从服务器上下载它们.带有--depth 1的浅表克隆会跳过大多数blob,但也会跳过下载除一次以外的所有提交的元数据.

A bare clone helps me to get rid of the working copy of the blobs, but it still downloads them from the server. A shallow clone with --depth 1 skips most blobs, but also skips downloading the metadata for all commits except one.

是否存在像git fast-export --no-data这样的东西,我可以在客户端使用它来获取包含提交元数据甚至文件名的图形信息,而无需先从服务器上克隆存储库?理想情况下,我将能够通过git log|show|rev-parse|show-ref像其他任何(裸,浅)回购一样访问元数据.

Is there something like git fast-export --no-data which I can use on the client-side to get the graph information containing commit metadata and maybe filenames without cloning the repository from my server first? Ideally I would be able access the metadata like any other (bare, shallow) repo via git log|show|rev-parse|show-ref.

(我知道git LFS和git Annex存在,并且可以帮助减小某些存储库的大小,但是如果不更改它们,我将无法在现有存储库中使用它们.)

(I know git LFS and git Annex exist and can help reduce the size of some repos, but I can't use them on an existing repository without changing it.)

推荐答案

是否可以在客户端使用git fast-export --no-data之类的东西?

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

否:在 git ls-remote 旁边(仅获取远程仓库的负责人),其他任何事情都将获得完整的仓库历史记录.

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

您将需要由Git托管服务(例如GitHub)来管理您的存储库,并提供API(例如

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.

这篇关于Git克隆裸回购没有斑点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆