MicrolearnENPTES

Reading the history

Lesson 4 of 24 · Git.Micro

Each commit remembers its parent, so the commits form a chain: the history. git log walks it from the newest commit back to the first.

git log shows hash, author, date and message; git log --oneline shows one line per commit.

git show <hash> shows one commit and exactly what it changed.

You don't need the whole hash: the first 7 characters are enough for Git to find the commit.

Check yourself

git log --oneline prints a1b2c3d Fix typo. What is a1b2c3d?

The number of the commit, counting from 1

List the history in short form, find the commit that added the prices page and open it with git show.

You opened “Add prices page” with git show

Do it in the browser: a real Git tool, a short mission and instant feedback. No install.

Start this lesson — free
← Your first commitWhat changed? git diff →

All lessons · Git.Micro