Skip to content

SCM: Support staging selected changes for *new* files too #78046

@rawtaz

Description

@rawtaz

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.

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalitygitGIT issueshelp wantedIssues identified as good community contribution opportunitiesverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions