-1

I would like to see what kind of change was made to each file in a commit. That is to see whether a file was modified, added or deleted.

For example, this gives a list of all files changed in a commit:

git show --pretty="format:" --name-only <SHA>

It would be nice to have a similar list where there is also information for each file about the change: added (new), modified or deleted. How to see this information?

Thank you!

1 Answers1

1

Use

git show --pretty="format:" --name-status <SHA>

the output will be

A       src/addedFile
D       src/deletedFile
M       src/modifiedFile
René Link
  • 48,224
  • 13
  • 108
  • 140
  • thank you very much! git log -n1 --name-status is what I need. I need only to get rid of the info that comes before the list of files (commit, author, date and commit message), which I can do with grep/sed or similar... or is there any way to show only the list of files? – Alex Chpenst Sep 10 '15 at 08:42
  • Thank you all! This prints only the list of files with status: git show --pretty="format:" --name-status – Alex Chpenst Sep 10 '15 at 09:13