Command

git log

Lists reachable commits, defaulting to HEAD when no starting revision is supplied. Options select and format history; does not switch branches.

Formal Syntax & Structure

git syntaxgit
git log [options] [revision] [-- path]

Working Example

Example Snippetgit
git log --oneline -n 2
Git Reference