git

Git diff in summary?


With git pull, it shows a diff summary like this:

Updating 6a78751..811f788
Fast-forward
 app/Http/Controllers/SaleController.php    |   7 +-
 .../views/pages/sale/create.blade.php      | 137 +++++++++++++---
 resources/views/pages/sale/index.blade.php |   4 +-
 resources/views/pages/sale/show.blade.php  |   5 +-
 4 files changed, 123 insertions(+), 30 deletions(-)

Is there a way to use commands like git diff to get similar output?


Solution

  • git log --stat will show the amount each file was changed.

    git whatchanged gives some detail into the files that were modified.

    git diff --stat <sha1> <sha2> gives the files and the amount of changes between two commits.

    git diff --stat <branch> to compare to another branch (e.g. master)