6 git-apply - Apply patch on a git index file and a work tree
12 'git-apply' [--stat] [--numstat] [--summary] [--check] [--index] [--apply]
13 [--no-add] [--index-info] [--allow-binary-replacement] [-z]
18 Reads supplied diff output and applies it on a git index file
24 The files to read patch from. '-' can be used to read
25 from the standard input.
28 Instead of applying the patch, output diffstat for the
29 input. Turns off "apply".
32 Similar to \--stat, but shows number of added and
33 deleted lines in decimal notation and pathname without
34 abbreviation, to make it more machine friendly. Turns
38 Instead of applying the patch, output a condensed
39 summary of information obtained from git diff extended
40 headers, such as creations, renames and mode changes.
44 Instead of applying the patch, see if the patch is
45 applicable to the current work tree and/or the index
46 file and detects errors. Turns off "apply".
49 When --check is in effect, or when applying the patch
50 (which is the default when none of the options that
51 disables it is in effect), make sure the patch is
52 applicable to what the current index file records. If
53 the file to be patched in the work tree is not
54 up-to-date, it is flagged as an error. This flag also
55 causes the index file to be updated.
58 Newer git-diff output has embedded 'index information'
59 for each blob to help identify the original version that
60 the patch applies to. When this flag is given, and if
61 the original version of the blob is available locally,
62 outputs information about them to the standard output.
65 When showing the index information, do not munge paths,
66 but use NUL terminated machine readable format. Without
67 this flag, the pathnames output will have TAB, LF, and
68 backslash characters replaced with `\t`, `\n`, and `\\`,
72 If you use any of the options marked ``Turns off
73 "apply"'' above, git-apply reads and outputs the
74 information you asked without actually applying the
75 patch. Give this flag after those flags to also apply
79 When applying a patch, ignore additions made by the
80 patch. This can be used to extract common part between
81 two files by first running `diff` on them and applying
82 the result with this option, which would apply the
83 deletion part but not addition part.
85 --allow-binary-replacement::
86 When applying a patch, which is a git-enhanced patch
87 that was prepared to record the pre- and post-image object
88 name in full, and the path being patched exactly matches
89 the object the patch applies to (i.e. "index" line's
90 pre-image object name is what is in the working tree),
91 and the post-image object is available in the object
92 database, use the post-image object as the patch
93 result. This allows binary files to be patched in a
98 Written by Linus Torvalds <torvalds@osdl.org>
102 Documentation by Junio C Hamano
106 Part of the gitlink:git[7] suite