3 ms·
An alternative is using TUI application like vim in conjunction with tools like recountdiff and git apply to handle staging and unstaging parts of files. You g
by u801e 7y ago
An alternative is using TUI application like vim in conjunction with tools like recountdiff and git apply to handle staging and unstaging parts of files.
You get more context because you can see other parts of the diff in the editor, unlike when using the -p switch with the git add or reset commands.
- konart 7y agoI'm actually using NeoVIM + fugitive and git-gutter. GitGutter make working with hunks easy
- u801e 7y agoLooking at the README of vim-gitgutter[1] (assuming that's the plugin you're referring to), it says the following: >> You cannot unstage a staged hunk. I'm not sure if that's a feature they plan to support, but something like this could easily be done by highlighting the hunk displayed when running git diff --cached in vim's linewise visual mode and filtering it through git apply -R --cached -. [1] https://github.com/airblade/vim-gitgutter https://github.com/airblade/vim-gitgutter