how can I list all the different versions of a file, and diff them also?

前端 未结 4 1378
慢半拍i
慢半拍i 2020-12-15 04:29

using git, I want to list all the different revisions of a given file.

Then, I want to choose a particular version and compare it when another.

How can I do

4条回答
  •  别那么骄傲
    2020-12-15 04:42

    Use the standard GUI tool of git:

     gitk --all -- path/to/file
    

    It displays the version history stripped down to the commits that affect path/to/file.

    As display mode for the comparison between the current (new) version and the preceding (old) version you can choose:

    • old version or
    • new version or
    • diff

    Additionally, you can select a commit and then right click another commit and choose Diff this -> selected in the context menu. Everything that you wished for.

提交回复
热议问题