Reading Git History: The log Flags Worth Knowing

Reading Git History: The log Flags Worth Knowing

21 October 2026 · By Laravel Git · 2 min read

Plain git log prints every commit at full width, oldest context buried pages deep. Nobody reads it. The flags below are the difference between archaeology and a quick look at the map.

The map#

git log --oneline --graph --decorate

One line per commit, branch structure drawn, branches and tags labelled. Add --all to see every branch at once instead of just the one you are on. This combination answers “where is everything right now” faster than any GUI, and it is the natural first step before a rebase or a release.

The filter#

git log --oneline --since="2 weeks ago" --author=sara

Time and author filters narrow the noise. The one that earns its keep before a release:

git log --oneline v1.4.0..main

Everything on main since the tag - exactly the input a changelog needs.

The detail#

When a commit list shows something interesting, two flags show what it did without leaving the log:

git log --stat     # files changed and how much
git log -p         # the full diff per commit

The tracers#

Two more for tracking specific things through time:

git log --follow -p -- app/Models/Invoice.php   # history across renames
git log -S 'QUEUE_CONNECTION' --oneline          # when did this string appear or vanish

--follow matters on Laravel apps, where files move as the structure settles; the pickaxe (-S) finds the commit that introduced or removed a setting, a call, or a constant.

What a branch actually adds#

Before reviewing or merging:

git log --oneline main..feature/invoice-pdf

Just the commits the branch contributes, nothing main already has. Pair with git diff main...feature/invoice-pdf --stat and you know the shape of a PR before opening it.

None of this needs memorising as a wall of flags. Keep the map (--oneline --graph --decorate) as a shell alias, learn the range form (a..b), and look the rest up when you need it - the habit that matters is reading history before you change it.

Share this post

Our network