Git Cheat Sheet · Explore
Browse history
git log --graph --all
git log lists commits from newest to oldest. With --graph --oneline --all, it draws in text how branches split and join. Merathon always shows this same graph in the center of the window.
What it does
Shows the commits and how branches split and join.
A use case
You are looking for when a feature was merged and by whom.
On the command line
git log --oneline --graph --all- Compact graph of all branches.
git log --author="Julie"- Commits by one person.
git log --since="2 weeks ago"- Commits from the last two weeks.
git log --grep="invoice"- Commits whose message contains a word.
git log -p -- <file>- A file's history, with the diff of each commit.
git log -S "functionName"- Commits that added or removed this text.
In Merathon
- The graph takes up the center of the window.
- The search field at the top right filters by message, author or hash.
Frequently asked questions
How do I find when a line was changed?
git blame <file> gives the last commit of each line; git log -L 10,20:<file> follows the history of a passage.
How do I quit git log?
Press q: the output goes through a pager.