How do I view previous diff commits using Git?

后端 未结 3 893
执念已碎
执念已碎 2021-01-31 01:38

How do I view previous diff commits using Git?

I have a file that I\'ve made several commits on, but I want to view previous versions of the file AND its diff\'s at diff

相关标签:
3条回答
  • 2021-01-31 02:01

    You need git log. If you were interested in file SOMEFILE use

    $ git log -p SOMEFILE
    

    The -p option displays the patch which is probably the diff you are looking for.

    0 讨论(0)
  • 2021-01-31 02:13

    If you don't want to specify a particular file, and see the diff for all files changed, just use

    $ git log -p
    
    0 讨论(0)
  • 2021-01-31 02:21
    git log --full-diff -p your_file_path
    

    Check out:
    http://git-scm.com/docs/git-log

    0 讨论(0)
提交回复
热议问题