How can I commit some changes to a file, but not others, in VSCode?
Open up the Source Control view, then click a changed file to open the comparison. Select the lines you want to stage. Click ‘…’ then Stage Selected Ranges (in the ··· at the top-right corner of the editor, not the ··· at the top of the git panel on the left).