Daily Workflow

Viewing History

~15 min

Viewing History

One of Git's superpowers is letting you travel through time. Every commit is a snapshot you can inspect, compare, or return to.

â„šī¸Repository ready

We've prepared a repository with 4 commits for you to explore.

Your Commit History

No commits yet.

Try These Commands

Use the Terminal to explore history. Follow the steps to see different views of the same commits.

Steps

1

View Full History

See each commit with full details.

Show the full log:

git log

This shows hash, author, date, and message for each commit.

In VS Code

Open the Source Control tab and scroll to the Graph section to see the same commits visually.

2

Compact View

Scan history quickly.

3

Inspect a Commit

Look at a single commit in detail.

4

Compare Commits

See what changed between two commits.

đŸ’ģ Terminal

Terminal — /
Repository with 4 commits ready.
Try: git log
$

📝 VS Code

Explorer
No files yet.
Click + to create a file.

Select a file to edit

Useful git log Options

git log --oneline

Compact one-line view

git log --graph

ASCII graph of branches

git log -p

Show changes in each commit

git log -n 5

Show only last 5 commits

git log --author="name"

Filter by author

git log --since="2 weeks ago"

Filter by date

Referencing Commits

ReferenceMeaning
HEADCurrent commit (where you are now)
HEAD~1One commit before HEAD (parent)
HEAD~3Three commits before HEAD
abc1234Specific commit by hash (first 7 chars)
mainLatest commit on the main branch