three areas
Git's model of where a change can be: the working tree on disk, the staging area waiting for the next commit, and the repository of recorded commits.
In more detail
git add copies from the working tree to the staging area, git commit records the staging area as a new commit in the repository, and git status reports the differences between all three. Most confusion about Git clears up once you ask which of the three areas a command changes.
Related terms
- working tree — The files of a Git repository as they currently exist on disk, which you edit before staging and committing.
- staging area — Git's list of exactly what the next commit will contain, kept in the file .git/index; also called the index.
- repository — A project folder whose full history is tracked by version control; in Git, your files plus the hidden .git directory that stores every commit.
- git status — The Git command that reports what is staged, what is changed but not staged, and what is untracked.
Taught in
- Why Version Control, And Why Git Won — Advanced Git Internals & Distributed Workflows
- The Three Areas: Working Tree, Index, Repository — Advanced Git Internals & Distributed Workflows
- Staging Deliberately: status, add, add --patch — Advanced Git Internals & Distributed Workflows
- Reading History: log, show And diff — Advanced Git Internals & Distributed Workflows