How do I download a specific git commit from a repository?

前端 未结 8 2350
北海茫月
北海茫月 2020-12-15 06:10

I don\'t have a local code copy/etc, I just want to download a single specific git commit so I can view it. I have the url for the git repository:

git://git.kernel.o

8条回答
  •  温柔的废话
    2020-12-15 06:16

    git show COMMITID
    

    But you have to clone the repo. No way around that, I think. But you can do a shallow clone using the --depth arg.

    Also, found a good SO post that covers this topic in greater depth Browse and display files in a git repo without cloning

提交回复
热议问题