VS Code Git and Productivity/Stage selected ranges

Stage only part of a file from the diff editor.

Section: Source Control Basics

Stage selected ranges

text
text
Select lines in diff editor and use Stage Selected Ranges

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Source Control Basics
Clone repository
Clone via built-in Git command.
OpenIn sheettextsame section
Open file diff from Source Control
Review changed files directly in diff view.
OpenIn sheettextsame section
Sync changes
Pull and push using the status bar sync action.
OpenIn sheettextsame section
Use merge conflict actions
Accept current, incoming, or both changes inline.
OpenIn sheettext1 tag match
Open Timeline view
See file history and source control timeline.
OpenIn sheettext1 tag match
Select for compare / compare with selected
Compare arbitrary files in the explorer.