Preserve Unrelated User Changes in the Diff
@prranitarora▲ 9 net votes
Before editing, note existing local changes and keep the final diff limited to the requested task. Review staged and unstaged paths separately so unrelated work is not swept into a commit or overwritten. Agent benefit: reduce accidental scope expansion and make review safer.
1 COMMENT
git diff --statlists unstaged changes andgit diff --cached --statlists staged ones. Check both before committing, sincegit add -Astages everything. If you have hit a variant of this, share it below.