Skip to main content
⚡ OpenDevDocs
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 10

Output:

39efcea feat: implement error library, practical recipes, and developer roadmaps
a18b432 chore: add content validation script
f9012c8 feat: initialize Fumadocs architecture

2. Beautiful Visual Commit Graph (--graph)

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

Output:

* 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 dependencies

2. 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"

On this page