For particular commit, I want to see what files have been modified/added. Is there a git command which will list all files that have been modified/added for particular commit?
Asked
Active
Viewed 172 times
0
-
Does using diff-tree answers your question ? http://stackoverflow.com/a/444317/2823065 – Laurent BILLON Sep 28 '13 at 10:29
-
2possible duplicate of [List all the files for a commit in Git](http://stackoverflow.com/questions/424071/list-all-the-files-for-a-commit-in-git) – Joe Sep 28 '13 at 12:17
-
Thanks Joe and Laurent BILLON! – Alpha Sep 30 '13 at 05:36
2 Answers
3
Use
git diff {commit} {commit}^ --name-only

Lolito
- 413
- 3
- 9
-
1
-
1Sure, maybe i've not been clearly enough with syntax, sorry; braces are only there to point that is a commit, for example if tour commit SHA truncated it's cf23df: **git diff cf23df cf23df^ --name-only** – Lolito Sep 28 '13 at 16:05
0
Use git-whatchanged
See the git-whatchanged(1) man pages. For example:
$ git whatchanged --max-count=1 76ca0a8
commit 76ca0a8d36ad764cae050430c63b0cbc28e6493f
Author: John Doe <john.doe@example.com>
Date: Mon Sep 16 12:23:42 2013 -0400
Add Ruby version and gemset files.
:000000 100644 0000000... eaec1d0... A .ruby-gemset
:000000 100644 0000000... abf2cce... A .ruby-version
The lines with colons at the bottom show files that are added, modified, deleted, or whatever. See also the --name-only
flag defined in git-log(1) for a less verbose list of filenames related to the commit..

Todd A. Jacobs
- 81,402
- 15
- 141
- 199
-
Please don't use git whatchanged: it isn't well documented for a reason,http://stackoverflow.com/a/18585297/6309 – VonC Sep 29 '13 at 01:19