git clone没有对象做git log [英] git clone without objects to do git log

查看:194
本文介绍了git clone没有对象做git log的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不获取实际文件及其所有修订增量的情况下克隆git存储库? 我只希望能够执行git log | grep,而无需访问文件的内容.

How can I clone a git repository without getting the actual files and all their revision deltas? I only want to be able to do git log | grep, no need to access files' contents.

我想跳过克隆的这一部分:

I would like to skip this part of the cloning:

Receiving objects:  12% (359112/2981072), 432.66 MiB | 1.67 MiB/s

有些存储库我想要grep的日志,但是没有下载/签出整个存储库,因为它们的重量为千兆字节.甚至我只得到单个分支的日志(例如master)的解决方案也会使我感兴趣,

There are some repositories whose logs I want to grep, but without downloading/checking out the whole repository, because they weigh gigabytes. Even a solution where I only get a single branch's logs (e.g. master) interests me, if that helps.

本质上,我正在为git寻找类似svn log <repo url>的东西.

Essentially I'm looking for something like svn log <repo url> for git.

推荐答案

我认为这是不可能的. 您最多只能做一个浅表克隆,只获取历史X的提交,但是对于他们,对象仍然会被下载. 唯一可以帮助您的是--single-branch选项,该选项仅下载一个分支而不是所有分支的历史记录.

I don't think this is possible. You can at most do a shallow clone, only getting the history X commits back, but for them the objects will still be downloaded. The only thing that could help you is the --single-branch option which only downloads the history for one single branch instead of all branches.

这篇关于git clone没有对象做git log的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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