在克隆之前查看github回购的大小? [英] See the size of a github repo before cloning it?

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

问题描述

在决定克隆之前,有什么办法可以看到Git上有多大的git repo?这似乎是一个非常明显的/基本的统计,但我无法找到如何在github上看到它。

一种通过 GitHub API 访问这些信息的方法。





当检索有关存储库的信息时,名为 size 用整个存储库的大小(包括它的所有历史记录)来计算,以千字节为单位。 例如,Git仓库重约40Mb。返回的JSON负载的 size 属性的值为 40764



更新:



大小实际上是基于服务器端裸仓库的磁盘使用量以千字节为单位表示的。但是,为了避免浪费太多空间,使用大型网络的存储库,GitHub依靠 Git Alternates 。在此配置中,计算裸仓库的磁盘使用情况不会考虑共享对象库,因此会通过API调用返回不完整值。



信息已由GitHub支持提供。


Is there any way to see how big a git repo is on github before you decide to clone it? This seems like a really obvious/basic statistic but I can't find how to see it on github at all.

解决方案

There's a way to access this information through the GitHub API.

When retrieving information about a repository, a property named size is valued with the size of the whole repository (including all of its history), in kilobytes.

For instance, the Git repository weights around 40Mb. The size property of the returned JSON payload is valued to 40764.

Update:

The size is indeed expressed in kilobytes based on the disk usage of the server -side bare repository. However, in order to avoid to waste too much space with repositories with a large network, GitHub relies on Git Alternates. In this configuration, calculating the disk usage against the bare repository doesn't account for the shared object store and thus returns an "incomplete" value through the API call.

This information has been given by the GitHub support.

这篇关于在克隆之前查看github回购的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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