AcademyTimeline Architect: Mastering the Time MachineProtocol 2: Forensic Analysis

Lesson 1: The Detective

Every great detective reconstructs the crime scene from evidence. In Git, the commit history is your evidence trail. It tells you exactly what changed, when it changed, and who changed it.

Reading the Crime Report: git log

The git log command shows the complete history of commits:

commit a1b2c3d4e5f6 (HEAD -> main)
Author: DevOps Cadet <cadet@cloudcorp.com>
Date:   Mon May 19 10:00:00 2025

    Fix database connection timeout

commit f6e5d4c3b2a1
Author: Senior Dev <senior@cloudcorp.com>
Date:   Sun May 18 22:30:00 2025

    Add user authentication module

Each commit shows:

  • Hash — The unique ID (like a fingerprint).
  • Author — Who made the change.
  • Date — When it happened.
  • Message — What was changed and why.

Compact View: git log --oneline

For a quick overview:

git log --oneline
a1b2c3d Fix database connection timeout
f6e5d4c Add user authentication module
9876543 Initial commit

Visual History: git log --graph

See the branch structure:

git log --oneline --graph --all
* a1b2c3d (HEAD -> main) Fix timeout
| * e4f5g6h (feature/login) Add login page
|/
* f6e5d4c Add auth module
* 9876543 Initial commit

Spotting Changes: git diff

git diff shows exactly what lines were added or removed:

- const timeout = 5000;
+ const timeout = 30000;
  • Red lines (-) — Removed.
  • Green lines (+) — Added.

Variants of git diff

| Command | Shows | |---------|-------| | git diff | Changes in working directory (not staged) | | git diff --staged | Changes that are staged (ready to commit) | | git diff HEAD~1 | Changes since the last commit | | git diff branch1 branch2 | Differences between two branches |

booting...

Mission Objective

Investigate the project history:

  1. Read the full report: Run git log to see the complete history.
  2. Quick scan: Run git log --oneline for a compact summary.
  3. Spot the changes: Run git diff to see any uncommitted modifications.

Mission Control

View the commit history

Expected Command

git log

View a compact one-line log

See what changed in a file