gitgit-show

How do I list all the files in a commit?


How can I print a plain list of all files that were part of a given commit?

Although the following lists the files, it also includes unwanted diff information for each:

git show a303aa90779efdd2f6b9d90693e2cbbbe4613c1d

Solution

  • Preferred Way (because it's a plumbing command; meant to be programmatic):

    $ git diff-tree --no-commit-id --name-only bd61ad98 -r
    index.html
    javascript/application.js
    javascript/ie6.js
    

    Another Way (less preferred for scripts, because it's a porcelain command; meant to be user-facing)

    $ git show --pretty="" --name-only bd61ad98    
    index.html
    javascript/application.js
    javascript/ie6.js