How to View Commit History for a Specific Git Branch
Learn how to view, compare, and filter commit history for individual branches — including commits unique to a branch and cross-branch comparisons.
View Commits on a Specific Branch
Pass a branch name to git log to see its commit history, even if you are currently on a different branch.
# View commits on a branch
git log feature-auth --oneline
# View commits on a remote branch
git log origin/main --onelineShow Commits Unique to a Branch
The double-dot syntax shows commits that are on one branch but not another. This is how you see "what work has been done on this feature branch since it diverged from main."
# Commits on feature-auth that are NOT on main
git log main..feature-auth --oneline
# Commits on main that are NOT on feature-auth
git log feature-auth..main --onelineThis is the same logic GitHub uses to populate a pull request's "Commits" tab — showing you exactly which commits would be merged.
Compare Two Branches
The triple-dot syntax shows commits that are on either branch but not both — the symmetric difference. This gives you a full picture of how two branches have diverged.
# All commits unique to either branch
git log main...feature-auth --oneline
# Same but mark which side each commit is on
git log --left-right main...feature-auth --onelineView All Branches at Once
Combine --all with --graph for a visual overview of how all branches relate. This is the terminal equivalent of a git GUI's branch visualization.
# Visual graph of all branches
git log --oneline --graph --all --decorate
# List all branches with their latest commit
git branch -v --allFor a more readable version of this across all your repos, Git Progress builds interactive visualizations of your branch and commit activity — no terminal needed.
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