Basic Usage
git log --oneline # One line per commit (most useful)
git log --oneline -10 # Latest 10 commits
git log --oneline --graph --all # Graph view of all branches
git log -p # Show diffs as well
git show <commit-id> # Details of a specific commit
Search and Filter
git log --author="name"
git log --since="2026-01-01"
git log --grep="keyword"
Check Diffs
git diff
git diff HEAD~1
Key Points
- Press
qto exitgit log --onelineis the most readable option
If you want to bring a specific commit to another branch, see How to Use git cherry-pick to Apply a Specific Commit.
Related Articles
- How to Undo a Git Commit
- How to Resolve Merge Conflicts from git pull
- How to Temporarily Save Work with git stash
- Git Branch Basics: Create and Switch Branches via CLI
Recommended Services
- Fiverr - Find freelance developers and tech experts