# Git Log

> A command that lists past commits, newest first. It shows who made each one.

**Field:** Software Development  
**Category:** Version Control  
**Also known as:** git log, Commit History, Git History

## Think of it like

Think of it like a diary of your project. Each entry says what happened, who did it and when.

## Definition

Git log lists the commits in your history, newest first. Each one shows its hash, its author, its date and its message. Options make the list short or add detail. A one-line view shows just the short hash and the title. You can also filter it, by author, by date or by file.

## Example

Jack wants to know when the login page changed. He runs git log on that one file and finds the commit in seconds.

## Example code

```console
$ git log --oneline -3
7b8c9d0 Fix the price on the order page
9f8e7d6 Add a dark mode switch
4c5d6e7 Write the first home page
```

The last three commits, one line each: short hash and title.

## Why it matters

It turns the history into answers: what changed, when, and by whom.

## Common mistake

Scrolling the full log by hand. Filter it by file or author to find the commit fast.

## Three principles

- **Newest first.** The latest commit is at the top.
- **One line each.** Use --oneline for a quick view.
- **Filter it.** By file, author or date.

## Related terms

- [Commit](https://learn.benibix.com/term/development/commit)
- [Commit Message](https://learn.benibix.com/term/development/commit-message)
- [Commit Hash](https://learn.benibix.com/term/development/commit-hash)
- [Git HEAD](https://learn.benibix.com/term/development/head)
- [Diff](https://learn.benibix.com/term/development/diff)

## Taught in

- [Git Log and Git Diff](https://learn.benibix.com/learn/development-version-control/git-log-and-git-diff): Git and GitHub, 3/13

![One commit drawn as a card. At the top, its hash, a long code of letters and numbers, with the first seven characters lit up as the short form. Below it, the author Emma and the date. Then the message: a title line under 50 characters, a blank line, and a body that says why. To the right, git log lists three commits, newest first, each as a short hash and its title.](https://learn.benibix.com/diagrams/dev3-commit-anatomy.svg)

---

Source: https://learn.benibix.com/term/development/git-log
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
