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] [--thread] 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 38If given --thread, git-format-patch will generate In-Reply-To and 39References headers to make the second and subsequent patch mails appear 40as replies to the first mail; this also generates a Message-Id header to 41reference. 42 43OPTIONS 44------- 45-o|--output-directory <dir>:: 46 Use <dir> to store the resulting files, instead of the 47 current working directory. 48 49-n|--numbered:: 50 Name output in '[PATCH n/m]' format. 51 52--start-number <n>:: 53 Start numbering the patches at <n> instead of 1. 54 55-k|--keep-subject:: 56 Do not strip/add '[PATCH]' from the first line of the 57 commit log message. 58 59-s|--signoff:: 60 Add `Signed-off-by:` line to the commit message, using 61 the committer identity of yourself. 62 63--stdout:: 64 Print all commits to the standard output in mbox format, 65 instead of creating a file for each one. 66 67--attach:: 68 Create attachments instead of inlining patches. 69 70--thread:: 71 Add In-Reply-To and References headers to make the second and 72 subsequent mails appear as replies to the first. Also generates 73 the Message-Id header to reference. 74 75CONFIGURATION 76------------- 77You can specify extra mail header lines to be added to each 78message in the repository configuration as follows: 79 80[format] 81 headers = "Organization: git-foo\n" 82 83 84EXAMPLES 85-------- 86 87git-format-patch -k --stdout R1..R2 | git-am -3 -k:: 88 Extract commits between revisions R1 and R2, and apply 89 them on top of the current branch using `git-am` to 90 cherry-pick them. 91 92git-format-patch origin:: 93 Extract all commits which are in the current branch but 94 not in the origin branch. For each commit a separate file 95 is created in the current directory. 96 97git-format-patch -M -B origin:: 98 The same as the previous one. Additionally, it detects 99 and handles renames and complete rewrites intelligently to 100 produce a renaming patch. A renaming patch reduces the 101 amount of text output, and generally makes it easier to 102 review it. Note that the "patch" program does not 103 understand renaming patches, so use it only when you know 104 the recipient uses git to apply your patch. 105 106 107See Also 108-------- 109gitlink:git-am[1], gitlink:git-send-email[1] 110 111 112Author 113------ 114Written by Junio C Hamano <junkio@cox.net> 115 116Documentation 117-------------- 118Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. 119 120GIT 121--- 122Part of the gitlink:git[7] suite 123