How to list all the files in a commit?

后端 未结 30 2811
一个人的身影
一个人的身影 2020-11-22 01:50

I am looking for a simple git command that provides a nicely formatted list of all files that were part of the commit given by a hash (SHA1), with no extraneous

30条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 02:28

    OK, there are couple of ways to show all files in a particular commit...

    To reduce the info and show only names of the files which committed, you simply can add --name-only or --name-status flag..., these flags just show you the file names which are different from previous commits as you want...

    So you can do git diff followed by --name-only, with two commit hashes after , something like below:

    git diff --name-only 5f12f15 kag9f02 
    

    I also create the below image to show all steps to go through in these situation:

提交回复
热议问题