]>
Commit | Line | Data |
---|---|---|
215a7ad1 JH |
1 | git-format-patch(1) |
2 | =================== | |
7fc9d69f JH |
3 | |
4 | NAME | |
5 | ---- | |
35ef3a4c | 6 | git-format-patch - Prepare patches for e-mail submission. |
7fc9d69f JH |
7 | |
8 | ||
9 | SYNOPSIS | |
10 | -------- | |
353ce815 | 11 | [verse] |
66f04f38 | 12 | 'git-format-patch' [-n | -k] [-o <dir> | --stdout] [-s] [-c] |
353ce815 | 13 | [--diff-options] <his> [<mine>] |
7fc9d69f JH |
14 | |
15 | DESCRIPTION | |
16 | ----------- | |
35ef3a4c | 17 | Prepare each commit with its patch since <mine> head forked from |
66f04f38 AE |
18 | <his> head, one file per patch formatted to resemble UNIX mailbox |
19 | format, for e-mail submission or use with gitlink:git-am[1]. | |
35ef3a4c | 20 | |
66f04f38 AE |
21 | Each output file is numbered sequentially from 1, and uses the |
22 | first line of the commit message (massaged for pathname safety) | |
23 | as the filename. | |
24 | ||
25 | When -o is specified, output files are created in <dir>; otherwise | |
26 | they are created in the current working directory. This option | |
27 | is ignored if --stdout is specified. | |
35ef3a4c JH |
28 | |
29 | When -n is specified, instead of "[PATCH] Subject", the first | |
30 | line is formatted as "[PATCH N/M] Subject", unless you have only | |
31 | one patch. | |
32 | ||
7fc9d69f JH |
33 | |
34 | OPTIONS | |
35 | ------- | |
6f855371 | 36 | -o|--output-directory <dir>:: |
35ef3a4c JH |
37 | Use <dir> to store the resulting files, instead of the |
38 | current working directory. | |
39 | ||
6f855371 | 40 | -n|--numbered:: |
35ef3a4c JH |
41 | Name output in '[PATCH n/m]' format. |
42 | ||
6f855371 | 43 | -k|--keep-subject:: |
35ef3a4c JH |
44 | Do not strip/add '[PATCH]' from the first line of the |
45 | commit log message. | |
46 | ||
6f855371 NW |
47 | -s|--signoff:: |
48 | Add `Signed-off-by:` line to the commit message, using | |
49 | the committer identity of yourself. | |
50 | ||
51 | -c|--check:: | |
52 | Display suspicious lines in the patch. The definition | |
53 | of 'suspicious lines' is currently the lines that has | |
54 | trailing whitespaces, and the lines whose indentation | |
55 | has a SP character immediately followed by a TAB | |
56 | character. | |
57 | ||
54ba6013 JH |
58 | --stdout:: |
59 | This flag generates the mbox formatted output to the | |
60 | standard output, instead of saving them into a file per | |
61 | patch and implies --mbox. | |
7fc9d69f | 62 | |
28ffb898 JH |
63 | |
64 | EXAMPLES | |
65 | -------- | |
66 | ||
67 | git-format-patch -k --stdout R1..R2 | git-am -3 -k:: | |
68 | Extract commits between revisions R1 and R2, and apply | |
69 | them on top of the current branch using `git-am` to | |
70 | cherry-pick them. | |
71 | ||
72 | git-format-patch origin:: | |
73 | Extract commits the current branch accumulated since it | |
74 | pulled from origin the last time in a patch form for | |
75 | e-mail submission. | |
76 | ||
803f498c JH |
77 | git-format-patch -M -B origin:: |
78 | The same as the previous one, except detect and handle | |
79 | renames and complete rewrites intelligently to produce | |
80 | renaming patch. A renaming patch reduces the amount of | |
81 | text output, and generally makes it easier to review | |
82 | it. Note that the "patch" program does not understand | |
83 | renaming patch well, so use it only when you know the | |
84 | recipient uses git to apply your patch. | |
85 | ||
28ffb898 JH |
86 | |
87 | See Also | |
88 | -------- | |
353ce815 | 89 | gitlink:git-am[1], gitlink:git-send-email[1] |
28ffb898 JH |
90 | |
91 | ||
7fc9d69f JH |
92 | Author |
93 | ------ | |
94 | Written by Junio C Hamano <junkio@cox.net> | |
95 | ||
96 | Documentation | |
97 | -------------- | |
98 | Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. | |
99 | ||
100 | GIT | |
101 | --- | |
a7154e91 | 102 | Part of the gitlink:git[7] suite |
7fc9d69f | 103 |