When I make changes to a file in Git, how can I commit only some of the changes?
For example, how could I commit only 15 lines out of 30 lines that have been changed
vim-gitgutter plugin can stage hunks without leaving vim editor using
:GitGutterStageHunk
Beside this, it provides other cool features like a diff sign column as in some modern IDEs
If only part of hunk should be staged vim-fugitive
:Gdiff
allows visual range selection then :'<,'>diffput
or :'<,'>diffget
to stage/revert individual line changes.