- Working Tree
- Index / Stage / Staging Area / Cache
- Repository
The Staging Area (also called the “index”) is where Git remembers which changes are marked to be committed. If a change is not “staged” it will not be committed. A change can be as granular as a single changed line in a file, leading to very precise commits. If, after staging a change, you decide you don’t want that change to go into the next commit, you can also “unstage” it.
Stage file: $ git add
Unstage file: $ git reset HEAD
Removing untracked files from your git working copy
$ git clean -f
git-clean
Removing untracked files from your git working copy