There's more...

The git format-patch command has many options besides the -<n> option to specify the number of commits in order to create patches for the -o <dir> for the target directory. Some useful options are as follows:

  • -s, --signoff: Adds a Signed-off-by line to the commit message in the patch file with the name of the committer. This is often required when mailing patches to the repository maintainers. This line is required for patches to be accepted when they are sent to the Linux kernel mailing list and the Git mailing list.
  • -n, --numbered: Numbers the patch in the subject line as [PATCH n/m].
  • --suffix=.<sfx>: Sets the suffix of the patch; it can be empty and does not have to start with a dot.
  • -q, --quiet: Suppresses the printing ...

Get Git Version Control Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.