The index is a separate snapshot between working tree and HEAD.
Git Easy · Lesson 1 · On the house
Staging area deeper
Craft the exact commit. Lesson 1 is free — on the house.
Lessons · Git Easy · Lesson 1 of 10 · On the house
Staging area deeper
Craft the exact commit.

You can stage part of a file with git add -p and leave other hunks unstaged.
git restore --staged path unstages without discarding working-tree edits.
status and diff --staged together tell you what the next commit will contain.
Clean commits are built in the index — not by hoping the working tree is tidy.
stage
git add -p
git diff --stagedQuiz
Quiz
Quiz
Check
Match the still for: Staging area deeper.
Open-book: the answers are on this page. Pass every quiz and check (4) to mark the lesson done. This visit: 0/4.