1 Answer

0 votes
by
 
Best answer

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

$ git diff-tree --no-commit-id --name-only -r bd61ad98
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

  • The --no-commit-id suppresses the commit ID output.
  • The --pretty argument specifies an empty format string to avoid the cruft at the beginning.
  • The --name-only argument shows only the file names that were affected (Thanks Hank). Use --name-status instead, if you want to see what happened to each file (Deleted, Modified, Added)
  • The -r argument is to recurse into sub-trees

Related questions

0 votes
    How will you find out what all files have been changed in a particular Git commit?...
asked Nov 4, 2020 in Technology by JackTerrance
0 votes
    How do you find a list of files that have changed in a particular commit?...
asked Nov 2, 2020 in Technology by JackTerrance
0 votes
    How do you find a list of files that have been changed in a particular commit?...
asked Oct 4, 2020 in Technology by Editorial Staff
0 votes
    How do I list all files of a directory?...
asked Jan 9, 2021 in Technology by JackTerrance
0 votes
    Select the 3 graphics files from the list below Choose all of the correct answers (multiple possibilities). Untitled ... jpg Unulled of Select the correct answer from above options...
asked Nov 29, 2021 in Education by JackTerrance
0 votes
    I am a little bit puzzled on the question of whether to commit .tfstate files to Git or not. The Terraform ... if so, why? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    What is the Git command to view all the changes since the last commit ? A. git clean B. git status C. git changes D. git commit...
asked Dec 21, 2022 in Technology by JackTerrance
0 votes
    What is the Git command to blow away all the changes in a file in the working area, since the previous commit? A. ... git log filename C. git checkout filename D. git rm filename...
asked Dec 21, 2022 in Technology by JackTerrance
0 votes
    How can we delete all files in a directory? (a) Files.delete(path) (b) Files.deleteDir() (c) Directory ... & Miscellaneous of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    How can we delete all files in a directory? (a) Files.delete(path) (b) Files.deleteDir() (c) ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    I would like to get the list of files exist in folder and subfolder with full path.Don't want any ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    What is the file extension of all the Gherkin files? 1. closure 2. doc 3. feature 4. com...
asked Jul 22, 2021 in Technology by JackTerrance
0 votes
    Let's say, I have a folder called maps and inside maps I have map1.txt, map2.txt, and map3.txt. ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    The below image shows my question in detail: it works when client version is changed to 5 beta but ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    I have an old, out-of-sync project code in the master branch. Several files have been deleted, ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 12, 2022 in Education by JackTerrance
...