Phase 2 · Version control
Day 4 · Tracking Changes Locally
Day 4

Tracking Changes Locally

~60 min

Goal — Turn my-first-site into a tracked repository and record your first snapshots.

By the end — my-first-site under Git, with a few commits and a readable history.

Tip

Map first — What is a commit, and what is a repository?

1Tell Git who you are

Git stamps every commit with a name and email. Set them once, globally, and every project inherits them.

Run in the terminal
git config --global user.name "Your Name"
Run in the terminal
git config --global user.email "you@example.com"

2Start tracking the project

Make sure you are inside my-first-site (run pwd to check). Then start tracking — this creates a hidden .git folder, and Git now watches this project.

Run in the terminal
git init

3Check the status

Git lists your files as "untracked" — it can see them but is not yet saving them.

Run in the terminal
git status

4Stage your files

Staging chooses what goes into the next snapshot. The . means "everything here." Run status again and the files show as staged, ready to commit.

Run in the terminal
git add .

5Take your first snapshot

The text in quotes is your message — a short note on what this snapshot contains.

Run in the terminal
git commit -m "Initial commit: project structure"

6Confirm and repeat

Run status again; it should say "nothing to commit, working tree clean." Now make any small change and repeat the loop.

Run in the terminal
git add . && git commit -m "describe the change"
Note

That loop — change, add, commit — is the heartbeat of version control.

7Read your history

See your snapshots, one per line, newest first. Each line is a short code (the commit's ID) and your message.

Run in the terminal
git log --oneline

Recap — You put my-first-site under Git and learned the change-add-commit loop that records every snapshot of your work.

Day 3Day 5