Autogenerated HTML docs for v1.1.5-gadda
[git.git] / git-format-patch.txt
1 git-format-patch(1)
2 ===================
3
4 NAME
5 ----
6 git-format-patch - Prepare patches for e-mail submission.
7
8
9 SYNOPSIS
10 --------
11 [verse]
12 'git-format-patch' [-n | -k] [-o <dir> | --stdout] [-s] [-c] [--mbox]
13                  [--diff-options] <his> [<mine>]
14
15 DESCRIPTION
16 -----------
17 Prepare each commit with its patch since <mine> head forked from
18 <his> head, one file per patch, for e-mail submission.  Each
19 output file is numbered sequentially from 1, and uses the first
20 line of the commit message (massaged for pathname safety) as the
21 filename.
22
23 When -o is specified, output files are created in that
24 directory; otherwise in the current working directory.
25
26 When -n is specified, instead of "[PATCH] Subject", the first
27 line is formatted as "[PATCH N/M] Subject", unless you have only
28 one patch.
29
30 When --mbox is specified, the output is formatted to resemble
31 UNIX mailbox format, and can be concatenated together for
32 processing with applymbox.
33
34
35 OPTIONS
36 -------
37 -o|--output-directory <dir>::
38         Use <dir> to store the resulting files, instead of the
39         current working directory.
40
41 -n|--numbered::
42         Name output in '[PATCH n/m]' format.
43
44 -k|--keep-subject::
45         Do not strip/add '[PATCH]' from the first line of the
46         commit log message.
47
48 -a|--author, -d|--date::
49         Output From: and Date: headers for commits made by
50         yourself as well.  Usually these are output only for
51         commits made by people other than yourself.
52
53 -s|--signoff::
54         Add `Signed-off-by:` line to the commit message, using
55         the committer identity of yourself.
56
57 -c|--check::
58         Display suspicious lines in the patch.  The definition
59         of 'suspicious lines' is currently the lines that has
60         trailing whitespaces, and the lines whose indentation
61         has a SP character immediately followed by a TAB
62         character.
63
64 -m|--mbox::
65         Format the output files for closer to mbox format by
66         adding a phony Unix "From " line, so they can be
67         concatenated together and fed to `git-applymbox`.
68         Implies --author and --date.
69
70 --stdout::
71         This flag generates the mbox formatted output to the
72         standard output, instead of saving them into a file per
73         patch and implies --mbox.
74
75
76 EXAMPLES
77 --------
78
79 git-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
84 git-format-patch origin::
85         Extract commits the current branch accumulated since it
86         pulled from origin the last time in a patch form for
87         e-mail submission.
88
89 git-format-patch -M -B origin::
90         The same as the previous one, except detect and handle
91         renames and complete rewrites intelligently to produce
92         renaming patch.  A renaming patch reduces the amount of
93         text output, and generally makes it easier to review
94         it.  Note that the "patch" program does not understand
95         renaming patch well, so use it only when you know the
96         recipient uses git to apply your patch.
97
98
99 See Also
100 --------
101 gitlink:git-am[1], gitlink:git-send-email[1]
102
103
104 Author
105 ------
106 Written by Junio C Hamano <junkio@cox.net>
107
108 Documentation
109 --------------
110 Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
111
112 GIT
113 ---
114 Part of the gitlink:git[7] suite
115