How to list all the files in a commit?

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

    I use changed alias a quite often. To set it up:

    git config --global alias.changed 'show --pretty="format:" --name-only'
    

    then:

    git changed (lists files modified in last commit)   
    git changed bAda55 (lists files modified in this commit)
    git changed bAda55..ff0021 (lists files modified between those commits)
    

    Similar commands that may be useful:

    git log --name-status --oneline (very similar, but shows what actually happened M/C/D)
    git show --name-only
    

提交回复
热议问题