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 withou
⚡ Summing up everything in this post with a gif.
···
at the top-right corner of the editor (not the ···
at the top of the git panel on the left)range
and then set a keyboard shortcut for this action.Peace! ✌️
Update: October 2017: In the latest VSCode as of October 2017 (version 1.18) you can actually stage specific lines really easy just like you would do it with the git CLI git add -p
. You just have to click on the edited line from the side like, watch the diff and apply it or not.
Use Interactive staging.
command - git add -p <file_name> this will show you the file, and you can choose which one you want to commit after parting the changes
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
.
This option has been moved to the palette:
shift+command+P and type "stage selected ranges"