TOPIC GIT
The Staging Area why git has three states
IN 10 SECONDS
The staging area (index) acts as a middle zone between your working directory (active files) and your commit history (snapshots), letting you select exactly what changes to commit.
GOTCHA Changes made after running git add will not be committed unless you run git add again to update the index state.
HOW FILES MOVE THROUGH STATES
01 Modify file changes files in working directory (untracked/modified status).
02 Stage changes runs git add, moving file changes into staging database index.
03 Commit snapshot runs git commit, writing staged index into repository history.
POKE IT YOURSELF
git status — check status of modified and staged files
git diff --staged — see code differences in files staged for commit
Drill this topic →
~60 sec read