How to view Git log

Viewing Git log is essential for understanding project history, tracking changes, and debugging issues by examining commit messages and authorship. As the creator of CoreUI with over 25 years of version control experience, I use git log extensively for code reviews, debugging, and project analysis. The most fundamental approach is using the git log command which displays commit history in reverse chronological order. This provides complete visibility into project evolution with detailed commit information and flexible formatting options.

Use git log command to view commit history with various formatting and filtering options for effective repository analysis.

# Basic commit history
git log

# Compact one-line format
git log --oneline

# Show detailed changes
git log --stat

# Graphical branch view
git log --graph --oneline --all

# Last 5 commits only
git log -n 5

# Commits by specific author
git log --author="John Doe"

# Commits since specific date
git log --since="2025-01-01"

# Custom format
git log --pretty=format:"%h - %an, %ar : %s"

The basic git log shows full commit details including hash, author, date, and message. The --oneline flag condenses each commit to a single line, --stat shows file change statistics, and --graph displays branch structure visually. Filtering options like --author, --since, and -n help narrow down results, while --pretty=format allows custom output formatting with placeholders for different commit data.

Best Practice Note:

This git log workflow is used daily in CoreUI’s development process for code reviews and debugging. Learn the common formatting options and create Git aliases for frequently used log commands to improve your productivity when analyzing repository history.


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