Git Pro Tips
Partial Staging
🗓️ Published: 4/15/2026 Originally on X: 7/7/2022

To stage only part of a file, use interactive add:
git add -i
Then type p for patch, choose the file, and pick the changes you want to stage.
Git Pro Tips

To stage only part of a file, use interactive add:
git add -i
Then type p for patch, choose the file, and pick the changes you want to stage.