Skip to main content

Sign in

Save your progress and access it from any device.

Or with email

Don't have an account?

Privacy policy

Git log: view the commit history

git log is your window into the project history. Who did what, when, and why. Discover the options to navigate commits efficiently.

The most useful git log options

--oneline

One line per commit (short hash + message)

--graph

Draw the branch graph in ASCII

--all

Show all branches, not just the current one

--author="name"

Filter by author

--grep="word"

Search in commit messages

--stat

List modified files per commit

-p

Show the full diff for each commit

-n

Limit to the last n commits (e.g., -5)

--since="2 weeks ago"

Commits since a given date

Git log in practice

Different ways to browse the history.

Simple history

Branch graph

Filters and search

Pro tip

The ultimate alias: git lg

Most developers create an alias for a readable history in one command:

git config --global alias.lg "log --oneline --graph --all --decorate"

Then simply type git lg for a complete visual history.

Part of the Git Basics guide

A

GitQuest is created by Anaïs (nouvelle fenêtre), web developer and head of education, specializing in tech training and digital accessibility.

Questions about git log

Explore the history in GitQuest

GitQuest investigations require you to navigate the history to solve mysteries.

Start the investigations