How to download a single commit-diff from GitHub?

后端 未结 2 426
忘掉有多难
忘掉有多难 2020-12-12 12:46

I would like to get a single commit (let\'s call it ${SHA}) from GitHub via the web-interface.

For example, something like:

$ git clone          


        
相关标签:
2条回答
  • 2020-12-12 12:57

    OK, found the answer myself.

    Adding .patch (or .diff) to the commit-URL will give a nice patch:

    https://github.com/foo/bar/commit/${SHA}.patch
    

    Thanks to Ten Things You Didn't Know Git And GitHub Could Do...

    0 讨论(0)
  • 2020-12-12 12:58

    I found I had to add a / at the end, i.e.

    https://github.com/foo/bar/commit/${SHA}.patch/
    
    0 讨论(0)
提交回复
热议问题