Previously in Part 1, we heard the story of how Linus Torvalds wrote Git in two weeks and it quietly took over the world — today, it takes over your computer too.

Install Git (two minutes, honestly)

Go to git-scm.com and download the installer for your system. On Windows, click Next through the installer — the defaults are fine. On a Mac, typing git in the Terminal will offer to install it for you. When it's done, open a terminal (Command Prompt, PowerShell, or Terminal — any of them) and verify:

git --version

If it replies with something like git version 2.47.0, you're in. The exact number doesn't matter.

Introduce yourself

Before Git will save anything for you, it wants to know who you are. Why? Because every version you save is stamped with an author — like signing the back of a photo. On a team, that's how everyone knows who changed what. Tell it once, and it remembers forever:

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

Use your real name and email. --global just means "for everything I do on this computer," so you never have to type it again.

The one mental model you need

Here is the picture that makes all of Git click. Look at it now; we'll refer to it for the rest of the series.

Working directory the files you edit Staging area the photo being posed History the photo album git add git commit
Every Git day, in one picture: edit files, pose the snapshot with git add, click the shutter with git commit.

Think of it as taking family photos:

  • The working directory is the messy room where life happens — your actual folder, your actual files, edited freely.
  • The staging area is posing for the photo. You choose who's in the frame: "you two, stand together — not you, you're still in pajamas."
  • History is the photo album. Once a photo is pasted in, it's permanent. You can flip back to any page, forever.

Git's three most important commands map exactly onto this: git add poses the photo, git commit clicks the camera and pastes it in the album, and git status tells you who's currently posing. That's it. That's the core of Git.

Workshop: your first repository

We're going to keep notes for an imaginary clinic — plain text files, nothing fancy. In your terminal, make a folder and step inside it:

mkdir clinic-notes
cd clinic-notes

Now the magic word:

git init

Git replies: Initialized empty Git repository in .../clinic-notes/.git/. Notice that .git at the end. Git created a hidden folder called .git inside your folder — that hidden folder is the photo album. Every version you ever save will live in there. You never open it, you never edit it, and you absolutely never delete it — deleting .git deletes your entire history. Everything else in the folder is just your normal files.

Note: Git may mention a branch named master (or on some setups, main). Same idea, different label — I'll say master in this series. Branches get their own whole part later; ignore them for now.

Take the first photo

Open any editor you like — Notepad is perfectly fine — and create a file called day-1.txt inside clinic-notes, with one line:

Asha visited today, prescribed rest.

Save it, then ask Git what it sees:

git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        day-1.txt

nothing added to commit but untracked files present (use "git add" to track)

Let's read that aloud together, because reading Git's output is a skill worth more than memorizing commands. "No commits yet" — the album is empty. "Untracked files: day-1.txt" — Git has spotted a new file it has never photographed. And look — it even tells you what to do next: use "git add" to track. Git's messages are unusually helpful once you slow down and actually read them.

So let's do exactly what it suggests. Pose the photo:

git add day-1.txt

Run git status again — the file has moved to a new section:

Changes to be committed:
        new file:   day-1.txt

"Changes to be committed" is the staging area. day-1.txt is posing, smiling, waiting. Click the camera:

git commit -m "Add notes from day one"
[master (root-commit) f3a91c2] Add notes from day one
 1 file changed, 1 insertion(+)

The -m is the message — the caption under the photo, so future-you knows what this version was about. And that jumble like f3a91c2? It's the photo's serial number. Yours will be different; that's fine.

Once more, so it sticks

Day two at the clinic. Create day-2.txt:

Ravi came in with a cough. Advised steam and honey.

Now run the full cycle yourself — status, pose, click, status:

git status
git add day-2.txt
git commit -m "Add notes from day two"
git status

That last git status should say "nothing to commit, working tree clean" — Git's way of saying every photo has been taken and the room is tidy. Now flip through your album:

git log
commit 8d2c4b7... (HEAD -> master)
Author: Your Name <you@example.com>
Date:   ...

    Add notes from day two

commit f3a91c2...
Author: Your Name <you@example.com>
Date:   ...

    Add notes from day one

Two photos, newest first, each with an author, a date, and a caption. Take a second here, really. Two days ago you had a folder full of final_v2_REALLY_final zips. Now you have a genuine, permanent, professional-grade history — the exact same mechanism that preserves the Linux kernel is preserving Asha's prescription for rest. You are officially version controlled.

Tip: Run git status constantly — before adding, after adding, whenever you're unsure. It changes nothing, costs nothing, and always tells you where you stand. Experienced developers type it the way nervous people check their pockets for keys.

Your album has two photos, but we haven't yet learned to compare photos, or what to do when a photo goes wrong. In Part 3, we learn to read history properly — and pull off our first rescues.