git clone without objects to do git log

拜拜、爱过 提交于 2019-12-22 07:57:11

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/36547904/git-clone-without-objects-to-do-git-log

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!