TWiStErRob
TWiStErRob

Reputation: 46460

git clone without objects to do git log

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

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.


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

Upvotes: 7

Views: 2890

Answers (1)

Adrian Macneil
Adrian Macneil

Reputation: 13263

Partial clone is now available in more recent versions of git:

git clone --filter=blob:none --no-checkout [email protected]:foo/bar.git

Upvotes: 6

Related Questions