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