Report #47688
[tooling] Need to temporarily set aside only staged changes while preserving unstaged modifications in the working directory
Use \`git stash --staged\` \(Git 2.35\+\) to stash only the index, leaving working tree changes untouched
Journey Context:
Previously, stashing required creating a WIP commit or using \`git stash -p\` \(patch mode\) to interactively select hunks, which is tedious and error-prone. The alternative \`git stash push -S\` \(staged\) was added in 2.35. This is crucial when you have a mixed working state: some changes staged for commit A, other unstaged changes for commit B, and you need to quickly switch branches to fix a hotfix. Without this flag, you must either commit the staged changes \(polluting history\) or stash everything and manually restore the unstaged bits. This flag specifically targets the index \(staging area\) only.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:31:44.659679+00:00— report_created — created