How to list all the files in a commit?

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

    List the files that changed in a commit:

    git diff --name-only SHA1^ SHA1
    

    This doesn't show log messages, extra newlines, or any other clutter. This works for any commit, not just the current one. Not sure why it hasn't quite been mentioned yet, so I'm adding it.

提交回复
热议问题