LLearnCode
Academy/git/Make reviewable changes

intermediate · 27 minute study

Branches are names that move through a graph

Reason about diverging work and merging without assuming a branch is a separate folder or that every merge creates the same history shape.

Loading progressEvidence grows with practice
Useful preparation · 1 prerequisite

Use this as a map, not a lock. If these ideas are familiar, continue.

First, build a mental model

A commit records a snapshot and parent links. A branch is a movable name pointing at a commit. HEAD normally identifies the checked-out branch; detached HEAD points directly at a commit.

  1. Creating a branch at the current commit creates another name at that position, not a full copy of every file.
  2. New commits advance the checked-out branch; other branch names stay where they were.
  3. A fast-forward moves a branch name to a descendant when no divergent merge is required.
  4. A merge of divergent histories usually creates a commit with both histories as parents, after content is reconciled.
  5. Fetch updates remote-tracking information without automatically merging it into the checked-out branch. Inspect ancestry before choosing the next operation.
Read the codeshell · educational example
# Start with main pointing at a known commit.
git switch -c feature/score-label
# Make one focused change, inspect it and commit it.
git log --oneline --decorate --all
git switch main
# If main has not moved and is an ancestor of the feature:
git merge --ff-only feature/score-label
# --ff-only refuses if a fast-forward is not possible.
  1. New branch

    main and feature initially name the same commit.

  2. Feature commit

    Only feature advances while it is checked out.

  3. Fast-forward

    If ancestry permits it, main can move to the feature commit without creating a merge commit.

Production thinking

Take this beyond the example.

Use graph inspection to understand what is local, what is shared and what changed upstream. Never treat a familiar branch name as proof that its content is still the version you reviewed.

Sources and further reading

Your evidence

unseen is a local learning signal, not a credential or proof of production competence.

Explain the mental model, then explicitly acknowledge it. Opening a page is not evidence.

Supported retries can complete this lesson. Independent evidence and delayed review determine the skill stage.

Next lesson · Resolve the intended behavior, not just the markers →