git is capable of stashing of individual hunks.
With
--patch
, you can interactively select hunks from the diff between HEAD and the working tree to be stashed. The stash entry is constructed such that its index state is the same as the index state of your repository, and its worktree contains only the changes you selected interactively. The selected changes are then rolled back from your worktree. See the “Interactive Mode” section of git-add[1] to learn how to operate the--patch
mode.
Is it possible to use it with magit frontend? Magit simplifies patch mode usage for staging spectacular. Could it do the same work for stashes?