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