克隆之前如何查看GitHub存储库的大小? [英] How can I see the size of a GitHub repository before cloning it?

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

问题描述

在决定克隆它之前,有没有办法查看GitHub上Git存储库的大小?

Is there a way to see how big a Git repository is on GitHub before you decide to clone it?

这似乎是一个非常明显的/基本的统计信息,但是我根本找不到如何在GitHub上看到它.

This seems like a really obvious/basic statistic, but I can't find how to see it on GitHub at all.

推荐答案

有一种方法可以通过

  • 语法:GET /repos/:user/:repo
  • 示例: https://api.github.com/repos/git/git
    • Syntax: GET /repos/:user/:repo
    • Example: https://api.github.com/repos/git/git

    检索有关存储库的信息时,将使用整个存储库的大小(包括其所有历史记录)(以千字节为单位)来命名名为size的属性.

    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.

    例如,Git存储库的权重约为124 MB.返回的JSON有效负载的size属性的值设置为124283.

    For instance, the Git repository weights around 124 MB. The size property of the returned JSON payload is valued to 124283.

    大小的确以千字节为单位,基于服务器端裸存储库的磁盘使用情况来表示.但是,为了避免使用大型网络的存储库浪费太多空间,GitHub依赖于

    The size is indeed expressed in kilobytes based on the disk usage of the server-side bare repository. However, in order to avoid wasting 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.

    此信息已由GitHub支持提供.

    This information has been given by GitHub support.

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

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