Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I see the list of changed files for a single commit, in Git?

Tags:

git

When I say git status I get a list of changed files. I'd like to get a list of changed files for a commit. Is there a way to use git show or some other command to do that? Thanks.

like image 443
nc. Avatar asked Feb 09 '11 07:02

nc.


People also ask

How do I see changes in a specific commit?

To see the changes between two commits, you can use git diff ID1.. ID2 , where ID1 and ID2 identify the two commits you're interested in, and the connector .. is a pair of dots. For example, git diff abc123.. def456 shows the differences between the commits abc123 and def456 , while git diff HEAD~1..

Can you display a list of files added or modified in a specific commit?

If you simply run git log command then you will get list of all Commits done till now. But if you use git log -p command, then you will see all the Commits along with the changes done in each Commit.


2 Answers

Yes, simply pass the --stat flag:

git show --stat 1268afe676e

For commits, git show takes the same formatting arguments as git diff-tree, so see the latter's documentation for other formatting options.

like image 53
bdonlan Avatar answered Sep 25 '22 04:09

bdonlan


Yes, use git log --stat or git log --stat COMMIT

like image 33
Natan Yellin Avatar answered Sep 29 '22 04:09

Natan Yellin