
Lesson 01 · 10 min
Repository, add, commit
Git remembers snapshots of a folder. add selects, commit records. It's not "save the file".
git init in the project folder creates a hidden .git directory: that's where the history lives. Your working files stay as they were. git status shows what Git sees: new, modified, already staged. Until you add and commit, the history is empty — even if the code is already written.
- A commit message says what changed and why, not "fix" ten times in a row.
.gitignoreis what never gets committed:node_modules,.env, the build.git diff— not staged yet.git diff --staged— already added, not committed yet.
Check
Lock it in before you move on
1. What does
git initdo?2.
git add filedoes3. You saved a file in the editor. Did Git see it as a commit?