Stage selected lines in a Git diff with fewer clicks.
- Open a Git diff in VS Code.
- Select the part of the changed text you want to stage.
- Wait briefly for the popup to appear.
- Click
Stage Selected Ranges.
The extension calls VS Code's built-in git.stageSelectedRanges command and leaves normal file selection behavior unchanged outside supported diff contexts.
- VS Code
1.90.0or later - built-in Git extension enabled
- a diff context where
Stage Selected Rangesis actually available
- Package the extension:
npm run package:vsix- Install using one of these methods:
Method A: VS Code UI
- Open Extensions panel (
Cmd+Shift+X/Ctrl+Shift+X) - Click the
...menu →Install from VSIX... - Select the
.vsixfile
Method B: Command Line
code --install-extension stage-selected-ranges-button-0.0.1.vsixInstall from VS Code Marketplace
- The popup is anchored near the active end of the selection to reduce overlap with the start of the selection.
- Open this folder in VS Code.
- Press
F5to launch an Extension Development Host. - In the new window, open a Git repository with modified files.
- Open a diff editor and test the selection flow.

