magit: how to diff the same file between two different commits on the same branch?

后端 未结 3 1283
走了就别回头了
走了就别回头了 2021-01-02 01:21

How can I get the diff between two commits of the same file using magit?

Directly form git one can do this. But I don\'t k

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-02 02:07

    Building up from @cdidyk answer, it is also (now) possible to select the range of the diff with text selection to go quicker than typing the hashes of the commits.

    So a quicker (and more visual) sequence could be :

    1. Select the commits using text selection C-SPC (or V if you use evil-mode)
    2. =f to specify the file (path relative to the project root folder)
    3. d to open the diff popup
    4. d to open the dwim buffer or r for diff range (They do mostly the same thing in this case, I think)

提交回复
热议问题