Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
SCM: Support staging selected changes for *new* files too #78046
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
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.