Great work!

XP to next level

BugEater

Reading the Story: git log and git log --oneline

Learning Objectives

By the end of this lesson you will be able to:

  • Read a full git log entry and name each of its parts
  • Use --oneline to scan a project's recent history quickly
  • Filter history by count, date, file, and author
  • Find the commit that a build under test was made from

The Default View

git log
commit 4f2a1c9b8e7d6c5a4b3f2e1d0c9b8a7f6e5d4c3b
Author: Olena Kovalenko <olena@example.com>
Date:   Mon Aug 17 09:41:22 2026 +0300

    Add negative cases to login smoke checklist

commit 91bd4e7f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d
Author: Dmytro Shevchenko <dmytro@example.com>
Date:   Fri Aug 14 17:03:55 2026 +0300

    Update staging DB connection string after migration

Four parts per entry:

  • commit — the full 40-character hash, this commit's permanent unique address
  • Author — the name and email from git config, which is why setting them correctly mattered
  • Date — exactly when it was committed
  • Message — the story, indented below

Newest first. Press q to exit — git log opens in a pager, and "how do I get out of git log" is a rite of passage.

The View You'll Actually Use

Full entries are four lines each; twenty commits fill your screen. This is the version experienced users live in:

git log --oneline
4f2a1c9 Add negative cases to login smoke checklist
91bd4e7 Update staging DB connection string after migration
c7f0a12 Remove flaky wait from checkout regression suite
4e9d331 Document reproduction steps for BUG-441
0b2c8a5 Add smoke checklist for the new payments flow

Short hash, subject line, one commit per row. In ten seconds you can see what a team has been doing — and this is exactly why the previous lesson pushed so hard on subject lines under 50 characters. This view is what they're for.

Filtering: Getting to the Commits You Care About

A year-old project has thousands of commits. You almost never want all of them.

The last N commits:

git log --oneline -10

Since a date — the "what landed since my last regression run?" query:

git log --oneline --since="2026-08-14"
git log --oneline --since="1 week ago"

Touching one file — the history of a single test or config:

git log --oneline -- config/test-env.yaml

Those two dashes separate paths from other arguments. Git needs them when a filename might be mistaken for a branch name.

By one person:

git log --oneline --author="Dmytro"

Searching messages — useful when your team references ticket IDs:

git log --oneline --grep="BUG-441"

Everything at once, which is a genuinely common QA query:

git log --oneline --since="1 week ago" --author="Dmytro" -- src/payments/

"What did Dmytro change in the payments code this week?" — answered in one line, with no meeting.

A Tester's Two Most Useful Views

What am I about to test? Point git log --oneline at the range since the last release and read the subjects. That's your risk map for the day.

Which commit is this build? Most CI systems stamp the build with a commit hash — check the build page, the app's About screen, or a version.txt in the deployment. Then:

git log --oneline -5 4f2a1c9

That shows the five commits ending at the one your environment is running, which is how you confirm you're testing what you think you're testing.

Pro Tip: git log --oneline --graph --all draws the branch structure as ASCII art alongside the commits. Branches are beyond this trail, but when a colleague asks "did that fix make it into the release branch?", this is the view that answers it at a glance.

Key Takeaways

  • git log shows hash, author, date, and message for each commit, newest first; q exits the pager
  • git log --oneline compresses each commit to one scannable row and is the everyday view
  • -10, --since, --author, --grep, and -- <path> narrow history to what you actually need
  • Filters combine, letting you answer questions like "what changed in this folder this week"
  • Listing commits up to a known build hash confirms exactly what your environment contains

Quiz

What does git log --oneline show for each commit?

Which command lists only the commits from the last week?

What do the two dashes do in git log --oneline -- config/test-env.yaml?

Your build page shows commit 4f2a1c9. What does git log --oneline -5 4f2a1c9 tell you?