WeCodeAcademy

Reading History with git log

git log shows the commits on your current branch, newest first. Add --oneline for a short list.

Examplebash
Open in editor »
/ $

Each commit has a short id (the 7 characters at the start). Ids are how Git names a snapshot.

Quick check

Which command shows a short, one-line-per-commit history?

Your turn: write the code

Make three commits (any files and messages), then print how many commits git log --oneline shows by piping it into wc -l.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.