Summary: Your first repo
What changed
Section titled “What changed”L1 taught the snapshot mental model. L2 turned the model into commands. You now have a working procedure for starting a tracked project and saving snapshots.
The three-area model
Section titled “The three-area model”working directory -> staging area -> repository (edit) (git add) (git commit)The working directory is what is on disk. The staging area is a draft of the next snapshot. The repository is permanent history.
The five core commands
Section titled “The five core commands”| Command | Purpose |
|---|---|
git init | Create a new repository in the current folder. Once per project. |
git status | Show the state of working directory + staging area + most recent commit. Run it often. |
git add <file> | Move changes from working directory into staging area. |
git commit -m "msg" | Take a snapshot of the staging area, with a message. |
(and) .gitignore | A file that lists patterns git should never track. |
The five things that always belong in .gitignore
Section titled “The five things that always belong in .gitignore”- Compiled output (
dist/,build/) - Dependencies (
node_modules/) - Editor files (
.idea/,.vscode/,.swp) - Secrets (
.env, credentials, anything with a password) - OS artifacts (
.DS_Store,Thumbs.db)
The one gotcha worth remembering
Section titled “The one gotcha worth remembering”.gitignore patterns with trailing slash (node_modules/) match directories only, not symlinks. Use bare name (node_modules) to match both.
What you carry into L3
Section titled “What you carry into L3”Muscle memory for the commit cycle. L3 teaches what makes a commit MEANINGFUL. The mechanics are now yours; the discipline is what comes next.
Remember this if nothing else
Section titled “Remember this if nothing else”Git stores snapshots. Every other command is just navigating those snapshots.