git - changed file summary like svn diff --summarize/svn status from console (no gitk)

StackOverflow https://stackoverflow.com/questions/1607337

  •  05-07-2019
  •  | 
  •  

Question

svn diff --summarize shows the changes at the file level for a commit. Output it something like:

 M   modified-foo.bar
 D   deleted-file.bar
 A   new-file.bar

Similar to svn status, but for commits. I would be happy with output similar to git status, but for a particular commit instead of the working copy. I know I could fire up gitk to see such a summary, but I want it in a shell.

Was it helpful?

Solution

git diff <commit> --name-status

OTHER TIPS

Try this:

git show <commit> --name-status

I think show is probably what you want rather than diff. show shows the changes of that commit. diff shows all the changes between the specified commit and the current working tree, unless you specifically give it a commit range.

Sometimes I like to see some graphical metrics of changes:

git show <commit> --stat

(Although that doesn't clearly indicate file additions and deletions distinctly from modifications.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top