I have 2 edits very close by (and therefore part of the same hunk), that I'd like to commit separately. Is it possible to split a hunk from within magit?

有帮助吗?

解决方案

You can set the mark correctly with Ctrl+Space (C-SPC) and magit will only commit the selected portion.

其他提示

You can also use - and + to decrease or increase the extent of the hunks in the diff (and 0 resets), but dominikh's answer is the most important one to know about.

Magit reuse diff-mode but don't expose many of diff-mode commands in its magit-revision-mode as this does VC package.

For example you can call diff-split-hunk which is usually C-c C-s in diff-mode.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top