How to view Git log with one line

Viewing Git log in one-line format provides a compact, scannable overview of commit history that’s perfect for quick reviews and branch analysis. With over 25 years of version control experience and as the creator of CoreUI, I use the one-line log format daily for efficient code review and project analysis. The most effective approach is using the --oneline flag which shows abbreviated commit hashes and the first line of commit messages. This provides maximum information density while maintaining readability for fast repository analysis.

Use git log --oneline to display commit history in a compact format with abbreviated hashes and concise commit messages.

# Basic one-line log
git log --oneline

# One-line log with limited number of commits
git log --oneline -10

# One-line log for specific branch
git log --oneline main

# One-line log with custom format
git log --pretty=format:"%h - %an, %ar : %s" -10

# One-line log for specific file
git log --oneline -- filename.js

# One-line log since specific date
git log --oneline --since="2025-01-01"

The --oneline flag combines --pretty=oneline and --abbrev-commit to show each commit on a single line with a shortened SHA hash and the commit message’s first line. This format is ideal for getting a quick overview of recent changes, identifying specific commits, or understanding project progression without overwhelming detail.

Best Practice Note:

This compact log format is essential in CoreUI’s daily development workflow for efficient code review and release planning. Combine with other options like --graph or --all to visualize branch structure while maintaining the compact, readable format.


Speed up your responsive apps and websites with fully-featured, ready-to-use open-source admin panel templates—free to use and built for efficiency.


About the Author