How to list all the files in a commit?

后端 未结 30 2832
一个人的身影
一个人的身影 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:26

    I personally use the combination of --stat and --oneline with the show command:

    git show --stat --oneline HEAD
    git show --stat --oneline b24f5fb
    git show --stat --oneline HEAD^^..HEAD
    

    If you do not like/want the addition/removal stats, you can replace --stat with --name-only

    git show --name-only --oneline HEAD
    git show --name-only --oneline b24f5fb
    git show --name-only --oneline HEAD^^..HEAD
    

提交回复
热议问题