Menu
Coddy logo textTech

Git Log

Part of the Version Control section of Coddy's Terminal journey — lesson 13 of 58.

Once you have made commits, you can browse the history with git log:

git log

It shows each commit with its full ID, author, date, and message, newest first. That is a lot of output for browsing, so most people use the compact form:

git log --oneline

This prints one line per commit: a short ID followed by the subject:

a1b2c3d Add first task
9f8e7d6 Add todo list

Useful flags include:

  • -n 5: show only the last 5 commits
  • --oneline: compact one-line-per-commit format
  • --reverse: flip the order so the oldest commit appears first

The list of subjects alone is often the fastest way to remember what you have been working on.

challenge icon

Challenge

Easy

The folder contains todo.txt. Initialize the repo, configure user identity, then create two commits in order:

  1. Stage and commit the file with the message Add todo list.
  2. Append the line buy milk to todo.txt, stage it, and commit with the message Add first task.

Then print the history with git log --oneline.

Cheat sheet

Browse commit history with git log:

git log

Compact one-line format (short ID + message):

git log --oneline

Useful flags:

  • -n 5 — show only the last 5 commits
  • --oneline — one line per commit
  • --reverse — oldest commit first

Try it yourself

Terminal
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Version Control