Tracking Changes Locally
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.
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.
git config --global user.name "Your Name"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.
git init3Check the status
Git lists your files as "untracked" — it can see them but is not yet saving them.
git status4Stage 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.
git add .5Take your first snapshot
The text in quotes is your message — a short note on what this snapshot contains.
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.
git add . && git commit -m "describe the change"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.
git log --onelineRecap — You put my-first-site under Git and learned the change-add-commit loop that records every snapshot of your work.