Git - Log Flashcards
Limit number of commits by . E.g. git log -5 will limit to 5 commits.
git log -
Condense each commit to a single line.
git log —oneline
Display the full diff of each commit.
git log -p
Include which files were altered and the relative number of lines that were added or deleted from each of them.
git log —stat
Search for commits by a particular author.
git log —author=“”
The —decorate flag makes git log display all of the references (e.g., branches, tags, etc that point to each commit.
This can be combined with other configuration options. For e.g. running git log —oneline —decorate
git log —oneline —decorate
The git shortlog command is a special version of git log intended for creating release announcements. It groups each commit by author and displays the first line of each commit message. This is an easy way to see who has been working on what.
git shortlog
- n : sort output according to the number of commits per author instead of author alphabetic order.
- s : suppress commit description and provide a commit count summary only.
- e : show the email address of each author.
Git log command provides an overview of entire repo commits but there is a command for directory specific commits
git log
e.g. git log /stylesheets (this command will provide the commits specific to this directory)