Git Commit List: How to List, Filter, and Format Commits
Master git log to list commits by author, date, file, and message. Practical examples for every filtering and formatting scenario.
List All Commits
The most basic way to see your commit list is git log. It shows commits in reverse chronological order — newest first — with the full hash, author, date, and message.
git logFor a condensed view, use --oneline to collapse each commit to a single line with an abbreviated hash and the first line of the message. This is usually what you want when scanning history quickly.
git log --onelineFilter Commits by Date
The --since and --until flags accept dates in multiple formats: ISO dates, relative dates, or natural language.
# Commits from the last week
git log --since="1 week ago"
# Commits in a date range
git log --since="2026-01-01" --until="2026-02-01"
# Combine with author
git log --oneline --author="Jane" --since="last Monday"List Commits That Changed a Specific File
Pass a file path after -- to see only commits that touched that file. This is invaluable when debugging regressions.
# Commits that changed a specific file
git log --oneline -- src/auth/login.ts
# Show the actual diff for each commit
git log -p -- src/auth/login.tsSearch Commit Messages
The --grep flag searches commit messages. Combine it with -i for case-insensitive search.
# Find commits mentioning "fix"
git log --oneline --grep="fix"
# Case-insensitive search
git log --oneline --grep="auth" -iCustom Output Formats
The --pretty=format flag gives you full control over what fields appear and how they are formatted. Here are the most useful placeholders:
- %h — abbreviated commit hash
- %an — author name
- %ae — author email
- %ar — relative date (e.g., "2 days ago")
- %s — commit subject (first line of message)
# Compact custom format
git log --pretty=format:"%h %ar %an: %s"
# CSV-friendly output
git log --pretty=format:"%H,%an,%ae,%ai,%s"If you find yourself running these commands regularly, Git Progress can generate these summaries automatically across all your repositories — no terminal required.
Stop running git log manually
Git Progress aggregates your commit history across GitHub, GitLab, and Bitbucket into beautiful dashboards. Free for individual developers.
Get Started Free