Installing Git & first commit
You know why version control exists now. Here's where it gets a name, a face, and your first real fight with a teammate.
Rachit messages the group: "ok I started on the hero section, it's looking decent, come see."
You go to his laptop. There it is — a folder called accelerate-website, an index.html, maybe forty lines of CSS he's proud of. It exists in exactly one place on Earth: his hard drive. Anvesha hasn't seen it. You haven't seen it. If his laptop's battery decides today is the day, forty minutes of work becomes zero minutes of work.
This is the moment you decide: no more solo folders. The three of you are going to use the thing you read about yesterday — Git — starting today, on this actual project, before anyone writes another line.
You open a terminal on Rachit's laptop. First problem, before you've even made a single commit: Git doesn't come installed by default on most machines, and even once it is, it doesn't know who any of you are.
Getting Git onto the machine
Pick your platform:
Windows
Download Git for Windows. It bundles Git plus Git Bash — a Unix-style shell that makes every tutorial in the world work as-is, instead of fighting Command Prompt's different syntax. Install with all defaults; the installer's forty-odd screens are almost all safe to click through.
macOS
Xcode Command Line Tools include Git: xcode-select --install. Or, for a newer version, Homebrew: brew install git.
Linux
sudo apt install git on Debian/Ubuntu, sudo dnf install git on Fedora.
Good. Git exists on the machine now. It still knows absolutely nothing about who Rachit is.
Here's a scenario that happens in the design lab downstairs every semester. There's a sign-up sheet on the door for booking lab time. It has one column: a time slot. No name column. Two people book 4 PM by writing "4–5 PM" on two different lines, and when there's a clash at 4:03, nobody can tell who has the actual claim — the sheet recorded that a booking happened, but not whose.
A commit without an identity is that sheet. Git will happily record a snapshot with zero information about who made it, and six months from now, when someone asks "wait, why does the hero section have this weird padding — who added it and can I ask them?", the answer would be a shrug. This is exactly the "you don't know when or why" failure from Chapter 1, except now it's "you don't know who." So before the first commit, every one of you sets an identity — once, on your own machine, and Git remembers it for every project you ever touch there:
12345+rachit@users.noreply.github.com — under Settings → Emails → "Keep my email addresses private." Commits made with that address still count as yours on GitHub, but the real address never appears in the public history. Worth setting up before your first push, not after.
Turning Rachit's folder into a repository
Now the actual moment. You're standing behind Rachit; he's got the folder open in the terminal.
git init."Nothing visibly changed. That's the point — git init just created one hidden folder, .git/, sitting quietly next to index.html. Every snapshot this project will ever have is going to live inside that folder. Delete it, and the project reverts to being just files with no memory. It's the difference between a house and a house with a foundation poured underneath it — from the street it looks the same, but only one of them can hold up a second floor.
git status is the command you will type more than any other for the rest of your life with Git. It costs nothing and it never lies. "Untracked" means: I see these files exist, but I've recorded nothing about them yet.
That's it. Forty minutes of Rachit's work is no longer just sitting on one laptop as loose files — it's a permanent, timestamped, attributed record. git add tells Git "these are the files I want in the next snapshot" (more on why this is a separate step from committing in Chapter 4). git commit takes the snapshot and signs it with the identity you configured a minute ago.
Keeping the noise out: .gitignore
Anvesha's about to start on content, which means she's about to run npm install for some Markdown-rendering package, which means a folder called node_modules is about to appear with roughly four thousand files in it that nobody wrote and nobody wants tracked. If she runs git add . blindly, all four thousand land in the repo, and every future git status becomes unreadable.
A file named .gitignore, sitting at the root of the project, tells Git which paths to never even mention:
# Compiled output / dependencies
node_modules/
dist/
# Editor cruft
.vscode/
.idea/
# Secrets — never commit these
.env
.env.local
# OS junk
.DS_Store
Thumbs.db
The .gitignore file itself gets committed — that's how the whole team ignores the same things without each of you configuring it separately.
.gitignore only stops future tracking — it does nothing for a file that's already committed. If a secret or a giant dependency folder is already in the history, run git rm --cached path/to/file, commit that removal, then add the ignore rule. And if the leaked thing was an actual credential, the file removal isn't the fix — the credential is now permanently in the repo's history and needs to be rotated at its source. Chapter 20 covers this properly.
Messages that survive the six-month test
Fast-forward: it's November, the club has doubled in size, and someone new is trying to understand why the hero section has a strange 14px margin on mobile only. They run git log and see:
fix: hero padding
adjust
Useless. Compare:
fix(hero): remove double padding on mobile breakpoint
The hero container and its inner wrapper both had 16px
horizontal padding below 480px, stacking to 32px total and
pushing the CTA button off-screen on small phones.
Tested on iPhone SE simulator and a real Redmi.
Same fix. One of these tells the future reader — who might be you — exactly what was wrong, why, and how it was verified. First line under 72 characters, imperative mood ("remove," not "removed"), blank line, then the reasoning. This isn't a style preference; it's the difference between your commit history being a second brain for the club and being decoration.
.env containing an API key, then pushed it. What actually protects the club now?.gitignore and rm --cached steps matter too, but only to stop it happening again — not to undo what already happened.
Rachit's first commit is in. Anvesha's about to make her second. There's now a real, shared, attributed history of the Accelerate website — and it's about to raise its first genuinely strange question: why doesn't this repository balloon in size every time someone commits the same untouched logo file for the tenth time?