Arc 1 Quest 02

The Three Halls of Knowledge

Git's 3-tree model

The Master Archivist looks at you with a solemn expression.

"You've joined the Guild, apprentice. But before you touch a single scroll, you must understand how our Archive works. Follow me... I'm going to show you the Three Halls."

He opens a heavy oak door and guides you down a long corridor lit by torches. Three immense halls open up before you.

Understand Git's 3-tree model: the three zones your files pass through before being archived.

The Three Halls of the Archive

Every Git repository is built on three distinct zones. The Master Archivist calls them the Three Halls:

🏠 Working Hall Working Directory You write, modify, and create your files here. It's the folder on your disk.
git add
📋 Preparation Hall Staging Area / Index You place the scrolls you want to archive here. It's the "basket" before sending.
git commit
📚 Grand Archive Repository / .git Scrolls sealed permanently. The complete and permanent history.

Every file passes through three zones: Working DirectoryStaging AreaRepository. Understanding this flow is the key to mastering Git.

Why three steps?

"Why not archive directly?" you ask.

The Master Archivist smiles. "Imagine you've written ten letters. Would you want to post them all at once, without rereading, without sorting?"

Analogy: The letter

Step Action Git equivalent
Write the letter You draft it at your desk Edit in the Working Directory
Put it in the envelope You choose what to send git addStaging Area
Post the letter It's sent, it's archived git commitRepository

The real power of staging

Staging lets you choose WHAT to archive - not everything at once!

  • You modify 10 files
  • But only 3 are ready
  • You run git add on just those 3 files
  • You run git commit: only those 3 are archived
  • The other 7 stay quietly in the Working Hall

Key commands

Command Role Transition
git status See which hall your files are in -
git add <file> Working Hall → Preparation Hall Working DirectoryStaging Area
git commit Preparation Hall → Grand Archive Staging AreaRepository

The colors of git status

  • Red = the file is in the Working Hall (modified or untracked)
  • Green = the file is in the Preparation Hall (ready to be archived)

Use git status often! It's your compass in the Archive.

Practical exercise

Time to get your hands on the scrolls! Follow these steps one by one.

1 Create your workshop

Open a terminal and create a new folder, then initialize a Git repository:

mkdir atelier-archiviste
cd atelier-archiviste
git init -b main

2 Create a scroll

Create a file called parchemin.txt with some content:

echo "This is my first parchment in the Archive." > parchemin.txt

3 Observe the Working Hall

Run the command:

git status

You should see parchemin.txt in red under the heading Untracked files. The file is in the Working Hall - Git can see it, but isn't tracking it yet.

4 Prepare the scroll

Move the file into the Preparation Hall:

git add parchemin.txt

5 Observe the Preparation Hall

Run again:

git status

This time, parchemin.txt appears in green under Changes to be committed. The scroll is in the Preparation Hall, ready to be sealed.

6 Do NOT commit!

For this exercise, do NOT run git commit. The goal is to understand the flow between the first two halls. The commit will come in the next quest!

7 Check your progress

Run the verification script from the atelier-archiviste folder:

Linux / macOS:

bash chemin/vers/quetes/02-les-trois-salles-du-savoir/verifier.sh

Windows (PowerShell):

& chemin\vers\quetes\02-les-trois-salles-du-savoir\verifier.ps1

Summary

🏠 Working Hall you modify red in git status
git add
📋 Preparation Hall git add green in git status
git commit
📚 Grand Archive git commit permanent history

The Master Archivist nods with satisfaction.

"You now understand the path of the scroll. In the next quest, you'll learn to seal your first entry into the Grand Archive."