Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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.

like image 751
noah Avatar asked Oct 22 '09 13:10

noah


People also ask

How do you find changed files in svn?

The solution here is to either update your working copy or explicitly provide a revision number to svn log by using the --revision ( -r ) option. svn log also takes a --quiet ( -q ) option, which suppresses the body of the log message. When combined with --verbose ( -v ), it gives just the names of the changed files.

How do I view a specific revision in svn?

To find information about the history of a file or directory, use the svn log command. svn log will provide you with a record of who made changes to a file or directory, at what revision it changed, the time and date of that revision, and, if it was provided, the log message that accompanied the commit.


2 Answers

git diff <commit> --name-status
like image 138
Vili Avatar answered Oct 12 '22 23:10

Vili


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.)

like image 23
Craig McQueen Avatar answered Oct 12 '22 23:10

Craig McQueen