Skip to main content

7.5 Plain Patches

W     (magit-patch)

This transient prefix command binds the following suffix commands along with the appropriate infix arguments and displays them in a temporary buffer until a suffix is invoked.

W c     (magit-patch-create)

This command creates patches for a set commits. If the region marks several commits, then it creates patches for all of them. Otherwise it functions as a transient prefix command, which features several infix arguments and binds itself as a suffix command. When this command is invoked as a suffix of itself, then it creates a patch using the specified infix arguments.

w a     (magit-patch-apply)

This command applies a patch. This is a transient prefix command, which features several infix arguments and binds itself as a suffix command. When this command is invoked as a suffix of itself, then it applies a patch using the specified infix arguments.

W s     (magit-patch-save)

This command creates a patch from the current diff.

Inside magit-diff-mode or magit-revision-mode buffers, C-x C-w is also bound to this command.

It is also possible to save a plain patch file by using C-x C-w inside a magit-diff-mode or magit-revision-mode buffer.