Skip to content
rajin

Learn from the Core

Git from the Core

From your first commit to internals and disaster recovery.

Understand the object database, the Index, refs and remotes well enough to predict what every command will do, then prove it in a real sandbox. Based on the second edition of the Git from the Core handbook: 8 modules, 32 lessons, each with a verified lab.

Curriculum

32 of 32 lessons published. Progress is saved in this browser.

How each lesson works

About 30 minutes, in four parts you can move between freely. It follows the handbook’s learning loop (p. 4); capstones take longer.

  1. 1Learn

    A two-minute warm-up from the last lesson, the problem, key terms, the model and a simulation you can drive.

    Handbook: Recall · Purpose · Understand

  2. 2Experiment

    Commit a prediction, then run the guided lab in a private sandbox. The server checks the resulting state.

    Handbook: Predict · Practice

  3. 3Challenge

    A goal without a recipe. Hints are there; using them is recorded as “with help”.

    Handbook: Practice (independent)

  4. 4Review

    Three questions from memory, a teach-back, and cards scheduled for spaced review.

    Handbook: Check · Reflect

Mastery checkpoint. Continue when you can explain the concept, predict the outcome and solve a variation. If not, revisit the relevant diagram, then retry without notes.

Choose your starting point

If you already use Git professionally, try these questions without looking at the answers.

  1. 1.What is the difference between saving a file, staging it and committing it?

  2. 2.What is a branch? What is HEAD?

  3. 3.What is the difference between fetch and pull?

  4. 4.Which command would undo a published commit without replacing history?

  5. 5.Can a staged but uncommitted file sometimes be recovered? Why?

If the first four answers are clear, you can start at lesson 4. If not, begin at lesson 1. Everyone should attempt the storage labs and final recovery challenges.

What you will be able to do

  • Explain blobs, trees, commits and refs, and compute an object ID by hand.
  • Predict exactly what add, commit, restore, reset and stash do to the working tree, Index and HEAD.
  • Merge, rebase, cherry-pick and resolve conflicts while reading every Index stage.
  • Collaborate through remotes without overwriting anyone’s work, including explicit force-with-lease.
  • Recover lost commits and staged-only files with reflog and fsck, and know what cannot be recovered.

Reference

Glossary, command decision guide, plumbing guide.

Mixed practice

Eight scenarios without the lesson name, plus capstones.

Review queue

Spaced retrieval on days 1, 3, 7, 14 and 30.

shop-app project

Eight cumulative milestones and a mastery rubric.

Run the labs locally instead (p. 5)

A terminal, Git 2.29 or newer, and a POSIX-compatible shell. On Windows use Git Bash or WSL; the examples use Bash syntax.

git --version
ROOT=$(mktemp -d "${TMPDIR:-/tmp}/git-core.XXXXXX")
mkdir "$ROOT/repo"
cd "$ROOT/repo"
git init -b main --object-format=sha1
git config user.name 'Git Learner'
git config user.email [email protected]
git config core.autocrlf false
git config commit.gpgsign false
git config gc.auto 0

Safety. Reset --hard, restore, branch deletion and forced push can lose work. This book uses only temporary repos and local bare servers. Before real recovery, preserve metadata and working files; a backup branch alone does not preserve unstaged edits.

Expected output: object IDs, timestamps, paths, hints and pack sizes vary. Labs were run with Git 2.47.3 on Linux; other platforms were not independently tested. The SHA-1 format and main branch are explicit to keep examples consistent.

About this course

Lesson text, labs, answers and exercises come from Git from the Core, second edition (an editorial self-study handbook, not an official Git publication). The interactive models, check-level verifiers and prediction options are additions for this web edition and are labelled as such.