--stat
Flags for git diff, git log and git show that summarise a change per file instead of printing every line: --stat counts lines and --name-status gives a letter per file.
In more detail
--stat prints each changed file with a count of inserted and deleted lines and a small bar. --name-status prints only a status letter, such as M for modified, A for added or D for deleted, and the path. Use them to see what a change touches before reading it in full.
Examples
git log --oneline --stat -1 HEAD~1git diff --name-status HEAD~4..HEAD~2Related terms
- git diff — The command that shows the differences between two of Git's states: the working tree, the staging area, or any two commits.
- git log — The Git command that lists commits with their identifiers, authors, times and messages.
Taught in
- The Three Areas: Working Tree, Index, Repository — Advanced Git Internals & Distributed Workflows
- Staging Deliberately: status, add, add --patch — Advanced Git Internals & Distributed Workflows
- Committing, And What A Good Message Says — Advanced Git Internals & Distributed Workflows
- Reading History: log, show And diff — Advanced Git Internals & Distributed Workflows