How to diff one file to an arbitrary version in Git?

前端 未结 13 2049
青春惊慌失措
青春惊慌失措 2020-12-07 07:12

How can I diff a file, say pom.xml, from the master branch to an arbitrary older version in Git?

13条回答
  •  隐瞒了意图╮
    2020-12-07 07:41

    If you are fine using a graphical tool (or even prefer it) you can:

    gitk pom.xml
    

    In gitk you can then click any commit (to "select" it) and right click any other commit to select "Diff this -> selected" or "Diff selected -> this" in the popup menu, depending on what order you prefer.

提交回复
热议问题