Git & GitHub · Lesson 8 of 144
Staging with git add
Choosing what to save.
Saving in Git takes two steps. First, you choose which changes go into the next snapshot. That's called staging. Then you take the snapshot. Git add is the first step.

- Saving takes two steps
- Step one: choose, with git add
- Step two: take the snapshot
git add
We type git add, and the file name. Again, silence means success. Now status. The file has moved, to changes to be committed, and it's shown in green. It's staged. It will go into the next snapshot.
git
git add index.html git status On branch main No commits yet Changes to be committed: (use "git rm --cached <file>..." to unstage) new file: index.html
The staging area
Think of the staging area like a box you're packing, before you post it. Git add puts a change into the box. You can add one file, or many. When the box looks right, you seal it, and that's the commit.
Summary
git add stages a change, which means it's chosen for the next snapshot. Next, we take the snapshot itself.
Key takeaways- git add <file>
- Staged files show in green
- Staging = choosing
Next up: Your First Commit — git commit -m