How to list all the files in a commit?

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

    A combination of "git show --stat" (thanks Ryan) and a couple of sed commands should trim the data down for you:

    git show --stat  | sed -n "/ [\w]\*|/p" | sed "s/|.\*$//"
    

    That will produce just the list of modified files.

提交回复
热议问题