git add — Staging Changes
git add moves changes from your working directory into the staging area (also called the index). Think of it as preparing a package — you carefully choose what goes in before sealing it with a commit.
01.The Staging Area Explained
The staging area sits between your working files and the repository. It gives you a chance to craft the perfect commit — grouping related changes together and leaving unrelated work for later. This two-step workflow (add then commit) is one of Git's most powerful features.
02.Selective Staging with -p
git add -p (patch mode) lets you stage individual lines or "hunks" within a file. You can make 10 changes in one file but only stage 3 of them for this commit. This is how experienced developers write clean, focused commit histories even while working messily.
Commands
What is the main purpose of the staging area?