Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.4k points)

I just want to see the files that were committed in the last commit exactly as I saw the list when I did git commit. Unfortunately searching for

git "last commit" log

in Google gets me nowhere. And

git diff HEAD^..HEAD

is not what I need, of course, since it spews the guts of the change too.

1 Answer

0 votes
by (27.5k points)

In order to see the files that were committed in the last commit this command can be used: 

$ git log --name-status HEAD^..HEAD

Here, --name-status is the key here; as noted by other folks in this question, you can use git log -1, git show, and git diff to get the same sort of output. You can also use git show <rev> when looking at individual revisions.

Browse Categories

...