tags:

views:

125

answers:

4

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.

+4  A: 

Perhaps using git show:

git show --summary

This will show the names of created or removed files, but not the names of changed files. The git show command supports a wide variety of output formats that show various types of information about commits.

Greg Hewgill
Or `git show --stat`.
jamessan
@jamessan `git show --stat` is close, but isn't there a view where the word 'modified' or 'added' appears next to the file?
Yar
If you want just the names of the files (even less than `--stat`), you may also want to look at `--name-status` and `--name-only` switches.
MikeSep
@MikeSep, that's actually what I needed. If you make it an answer I'll mark it best answer, since to me it was. I'm using `git log --name-status HEAD^..HEAD`
Yar
+2  A: 
$ git diff --name-only HEAD^..HEAD

or

$ git log --name-only HEAD^..HEAD
Greg Bacon
That's what I need pretty much. How about something saying whether it was modified, added or deleted? Maybe with a letter, svn-style?
Yar
Got it now. `git log --name-status HEAD^..HEAD`
Yar
Instead of `git log ... HEAD^..HEAD`, isn't it simpler to use `git log ... -1 HEAD`, or better `git show ... HEAD`?
Jakub Narębski
Nice one Jakub.
Yar
+2  A: 

As determined via comments, it appears that yar is looking for

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

This is also very close to the output you'd get from svn status or svn log -v, which many people coming from subversion to git are familiar with.

--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. Personally, I tend to use git show <rev> when looking at individual revisions.

MikeSep
This can be abbreviated to `git show --name-status`
Geoff Reedy
I admit, comments are not the best way for me to make my question cleaer :) thanks MikeSep
Yar
A: 
git log -1 --stat

could work

knittl