How to list all the files in a commit?

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

    Display the log.

    COMMIT can be blank ("") or the sha-1 or the sha-1 shortened.

    git log COMMIT -1 --name-only
    

    This will list just the files, very useful for further processing.

    git log COMMIT -1 --name-only --pretty=format:"" | grep "[^\s]"
    

提交回复
热议问题