Mike
Mike

Reputation: 553

Git - show with just file name and differences

I'd like to show results of git show in such way that it lists filenames and changes only, without other data, like this:

filename-1.txt
+Line added

filename-2.txt
+Line added
-Line removed

If it's not possible with git alone, grep etc are also ok.

Upvotes: -1

Views: 67

Answers (1)

LeGEC
LeGEC

Reputation: 52081

git show accepts the same options as git log:

# --format="" : display no information about the commit
# -U0 : display diff with no context lines
git show --format="" -U0 <commit-ish>

If you really want to get rid of all the extra lines (@@ -43,2 +45,7 @@, --- a/that/file, +++ b/that/file ...), you will need some scripting on the output.

Upvotes: 1

Related Questions