The staging area
Lesson 2 of 24 · Git.Micro
Before saving a version, you choose what goes into it. git add copies a file into the staging area (also called the index): the draft of your next commit.
Git has three areas: the working directory (your files), the staging area (the next commit) and the repository (saved commits).
git add file stages one file; git add . stages every change in the folder.
New files start as untracked: Git sees them but doesn't follow them until you add them.
Right after git add style.css, where is that version of the file?
In the staging area, ready for the next commit
Stage index.html and style.css for the first commit, but keep your personal notes in todo.txt out of it.
Do it in the browser: a real Git tool, a short mission and instant feedback. No install.
Start this lesson — free