Logs : Viewing Commit History

The git log command

  • Shows commit history in a repo.
  • Displays

    • Who made a commit
    • When the commit was made
    • What was changed

Common options:

  • git log -n 5 → show last 5 commits
  • git log --oneline → short, one commit per line alt text
  • git log --graph → shows branch structure visually alt text
  • git log --stat → shows files changed in each commit alt text