Skip to content

Latest commit

 

History

History
86 lines (55 loc) · 1.26 KB

File metadata and controls

86 lines (55 loc) · 1.26 KB

Git Log Guide

When to Use This Guide

Use git log when you need to inspect commit history, trace a change, understand branch relationships, or filter commits by author or date.

Basic Commands

Show the full history

git log

Show a compact one-line history

git log --oneline

Show a graph of branch history

git log --oneline --graph --decorate --all

This is especially helpful when you want to understand merges and parallel branch development.

Common Filters

Show the most recent 5 commits

git log -n 5

Filter by author

git log --author="Alice"

Filter by time range

git log --since="7 days ago"

Show history for one file

git log -- <filename>

Example:

git log -- README.md

Combine Log with Diff Output

Show a summary of changed files per commit

git log --stat

Show patch details for each commit

git log -p

A Handy Everyday Command

A common log command for day-to-day work is:

git log --oneline --graph --decorate -n 10

Notes

  • git log shows committed history, not uncommitted working tree changes.
  • To inspect uncommitted changes, use git status or git diff instead.