Browse, filter, and format Git commit history.
low risk
git log displays the commit history with flexible formatting. Supports filtering by author, date, path, and content. The --graph flag visualizes branch topology. A well-formatted git log is essential for code review, debugging, and release management.
| Flag | Meaning |
|---|---|
--oneline | Compact one-line per commit |
--graph | ASCII branch topology graph |
--author | Filter by author |
--since | Filter commits since a date |
--stat | Show file change stats per commit |
-p --patch | Show full diff per commit |
--follow | Follow file renames |
git log --oneline --graph --decorate --allVisual branch history for all branches · explain & risk-check →git log --since='2 weeks ago' --author='Eknatha' --onelineRecent commits by specific author · explain & risk-check →git log --stat HEAD~5..HEADFiles changed in last 5 commits · explain & risk-check →git log -S 'function_name' --onelineFind when a specific string was added/removed · explain & risk-check →git log --follow -p -- path/to/file.goFull history of a file including renames · explain & risk-check →Add `git log --oneline --graph --decorate --all` as an alias `git lg` — the graph view reveals merge topology that linear history completely hides.
Reference text is hand-written and may be incomplete — check man git for your version. Test destructive commands on a non-production system first.