-
Notifications
You must be signed in to change notification settings - Fork 37.9k
Description
In a file that was changed, one can go to the SCM sidebar, double click the changed file to get to the changes comparison view, select the lines one want to stage, and then right-click on them and select "Stage selected ranges". This will stage only the lines that were selected.
However, this only works for existing, changed, files. It does not work for new files that hasn't already been added to the repository. For those files, there's no "Stage selected ranges" option available in the menu.
Partially staging a file with git is a matter of git add -p <file> for existing files, but for new files one first has to run git add -N <file> followed by git add -p <file>.
I'm suggesting that support for partially staging new files is added to VS Code - perhaps it's a matter of just running that extra git command behind the scenes.