Documentation / git-format-patch.txton commit Merge branch 'jn/web' into next (4840122)
   1git-format-patch(1)
   2===================
   3
   4NAME
   5----
   6git-format-patch - Prepare patches for e-mail submission
   7
   8
   9SYNOPSIS
  10--------
  11[verse]
  12'git-format-patch' [-n | -k] [-o <dir> | --stdout] [--attach]
  13                   [-s | --signoff] [--diff-options] [--start-number <n>]
  14                   <since>[..<until>]
  15
  16DESCRIPTION
  17-----------
  18
  19Prepare each commit between <since> and <until> with its patch in
  20one file per commit, formatted to resemble UNIX mailbox format.
  21If ..<until> is not specified, the head of the current working
  22tree is implied.
  23
  24The output of this command is convenient for e-mail submission or
  25for use with gitlink:git-am[1].
  26
  27Each output file is numbered sequentially from 1, and uses the
  28first line of the commit message (massaged for pathname safety) as
  29the filename. The names of the output files are printed to standard
  30output, unless the --stdout option is specified.
  31
  32If -o is specified, output files are created in <dir>.  Otherwise
  33they are created in the current working directory.
  34
  35If -n is specified, instead of "[PATCH] Subject", the first line
  36is formatted as "[PATCH n/m] Subject".
  37
  38
  39OPTIONS
  40-------
  41-o|--output-directory <dir>::
  42        Use <dir> to store the resulting files, instead of the
  43        current working directory.
  44
  45-n|--numbered::
  46        Name output in '[PATCH n/m]' format.
  47
  48--start-number <n>::
  49        Start numbering the patches at <n> instead of 1.
  50
  51-k|--keep-subject::
  52        Do not strip/add '[PATCH]' from the first line of the
  53        commit log message.
  54
  55-s|--signoff::
  56        Add `Signed-off-by:` line to the commit message, using
  57        the committer identity of yourself.
  58
  59--stdout::
  60        Print all commits to the standard output in mbox format,
  61        instead of creating a file for each one.
  62
  63--attach::
  64        Create attachments instead of inlining patches.
  65
  66
  67CONFIGURATION
  68-------------
  69You can specify extra mail header lines to be added to each
  70message in the repository configuration as follows:
  71
  72[format]
  73        headers = "Organization: git-foo\n"
  74
  75
  76EXAMPLES
  77--------
  78
  79git-format-patch -k --stdout R1..R2 | git-am -3 -k::
  80        Extract commits between revisions R1 and R2, and apply
  81        them on top of the current branch using `git-am` to
  82        cherry-pick them.
  83
  84git-format-patch origin::
  85        Extract all commits which are in the current branch but
  86        not in the origin branch.  For each commit a separate file
  87        is created in the current directory.
  88
  89git-format-patch -M -B origin::
  90        The same as the previous one.  Additionally, it detects
  91        and handles renames and complete rewrites intelligently to
  92        produce a renaming patch.  A renaming patch reduces the
  93        amount of text output, and generally makes it easier to
  94        review it.  Note that the "patch" program does not
  95        understand renaming patches, so use it only when you know
  96        the recipient uses git to apply your patch.
  97
  98
  99See Also
 100--------
 101gitlink:git-am[1], gitlink:git-send-email[1]
 102
 103
 104Author
 105------
 106Written by Junio C Hamano <junkio@cox.net>
 107
 108Documentation
 109--------------
 110Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
 111
 112GIT
 113---
 114Part of the gitlink:git[7] suite
 115