tigで1行だけStage / Unstage する

help には全部書いてある。 stage viewで 1 を押すんだ。

いつもgitのコミットや差分確認にtigを使っているんだけど、この行だけStageに上げたいなーとかその逆をやりたいというときが出てくる。VSCodeのGit管理ではDiffを見ながら右クリックメニューから「選択した範囲をステージ」みたいなことができるので、tigでもできるでしょう。と探したら見つけた。デフォルトのキーバインディングで設定されているはず。

[-] stage bindings
View-specific actions
                           u status-update       Stage/unstage chunk or file changes
                           ! status-revert       Revert chunk or file changes
                           1 stage-update-line   Stage/unstage single line
                           \ stage-split-chunk   Split current diff chunk

stage-update-line というのがそれ。 これで stage-split-chunk で切り分けられなかった差分も拾ってStageにあげれて便利〜。