VSCode has excellent git integration but I can't find a way to do partial commits. Basically, I want to be able to select specific changes in my files and stage them without staging the entire file. This functionality is supported by the git CLI, Github native apps, and Atom plugins.
Mostly making sure I'm not just missing something before opening a ticket for it.
If you're using Git with Visual Studio 2015, from Team Explorer, right-click on just the file(s) you want to commit and select Stage. Now you'll have a new section above Changes called Staged Changes that only contain the file(s) you want. Type in your commit message and then select Commit Staged.
In this case, Visual Studio allows you to commit your changes directly without having to stage them. Just enter your commit message and then select Commit All. The equivalent command for this action is git commit -a .
Stage ChangesAfter you click on the files you want to stage, Visual Studio Code moves that file from the Changes folder to the Staged Changes folder, that means that now they are in the staging area. If you want to stage all your files at once, click the + button that appears when you hover over the Changes subtitle.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With