Staging with git add
Prepare and curate atomic commit snapshots using git add and the staging area (index).
Staging with git add is an essential topic in GIT.
Overview
Mastering staging with git add provides the core mental model and practical skills needed for real-world software engineering workflows.
# Stage a single file
git add src/index.ts
# Stage all modified and new files
git add .
# Interactive staging by hunk
git add -p
Key Concepts
- Understand the fundamental syntax, commands, and architecture.
- Learn standard conventions, safety guardrails, and common pitfalls.
- Apply practical idioms directly in production environments.
[!TIP] Practice these core patterns thoroughly. Next, proceed to git-commits.