如何克隆/获取回购协议仅获取历史记录 [英] How to clone/fetch a repo getting only the history

查看:80
本文介绍了如何克隆/获取回购协议仅获取历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以下载存储库的提交,分支和标记(不包括斑点和树)?我希望能够在不下载文件的情况下查看历史记录和其他信息(这是针对Chromium存储库的,这是多次演出).显然,我将无法查看哪些文件受到了提交的影响,但这很好.

Is it possible to download a repository's commits, branches, and tags, excluding blobs and trees? I would like to be able to view the history and whatnot without downloading the files (this is for the Chromium repo, which is multiple gigs). Obviously I will not be able to see which files were affected by a commit, but that's fine.

推荐答案

否,至少没有使用任何普通访问权限.一些站点提供Web访问,通过该Web访问,您可以获取每个提交对象的内容,而无需获取树和Blob对象,但是正常情况下,接收对象或精简包的过程在提交级别被截断(通过--depth),或者完成.

No, or at least, not using any ordinary access. Some sites offer web access, through which you can obtain the contents of every commit object without also obtaining tree and blob objects, but the normal process of receiving objects or thin packs is either truncated at the commit level (via --depth) or is complete.

当然,您可以通过git ls-remote以及通过任何明智的Web界面查看所有可见的标签(如果您不以这种方式提供标签,那么提供类似GitHub的精美API的方法将很奇怪).

You can of course see all visible tags with git ls-remote as well as through any sensible web interface (it would be weird to provide something like GitHub's fancy API if you didn't provide the tags that way :-) ).

请注意,由于必须停止并等待(如果是同步编程而不是作为流处理),或者由于主机上的限速软件(GitHub和Bitbucket似乎都可以进行速率限制.

Note that traversing all commits via a web API may be tremendously slow, either due to having to stop and wait (if you program it synchronously rather than as a streaming process) or due to rate limiting software on the host (GitHub and Bitbucket both seem to do rate limiting).

这篇关于如何克隆/获取回购协议仅获取历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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