Git
gitgitGuideBeginner
git log — Inspecting Commit History
Viewing repository history with git log: formatted oneline logs, commit graphs (--graph), author filtering, and file history inspection.
Verified: 2026-09-30
Platforms:
all
#git#log#history#graph
git log — Inspecting Commit History
The git log command displays committed snapshots in reverse chronological order, starting from the most recent commit on the current branch.
1. Useful Formatted Output Commands
1. Compact One-Line View (--oneline)
git log --oneline -n 10Output:
39efcea feat: implement error library, practical recipes, and developer roadmaps
a18b432 chore: add content validation script
f9012c8 feat: initialize Fumadocs architecture2. Beautiful Visual Commit Graph (--graph)
git log --graph --oneline --decorate --allOutput:
* 39efcea (HEAD -> main, origin/main) feat: implement roadmaps
* 7b30129 Merge pull request #4 from feature/auth
|\
| * 2a8f901 feat: add JWT session verification
|/
* 819c902 chore: update dependencies2. Filtering History
# Filter by author name/email:
git log --author="Alex" --oneline
# Filter by commit message content (grep):
git log --grep="PostgreSQL" --oneline
# Show only commits affecting a specific file:
git log -p content/docs/git/git-log.md
# Show commits within a date range:
git log --since="2026-09-01" --until="2026-09-30"Related Topics
git commit — Creating Permanent Snapshots
Creating commits in Git: writing semantic commit messages, amending the previous commit (--amend), atomic commits, and commit hashes (SHA-1).
git diff — Inspecting File Changes
Comparing changes in Git: working directory vs staging area, staged changes (--staged), comparing commits, and comparing branches.