git apply <patch...>

Apply a patch to files and/or to the index

Arguments

NameDescription
patch

Options

NameDescription
--exclude <path>Don't apply changes matching the given path
--include <path>Apply changes matching the given path
-p <num>Remove <num> leading slashes from traditional diff paths
--no-addIgnore additions made by the patch
--statInstead of applying the patch, output diffstat for the input
--numstatShow number of added and deleted lines in decimal notation
--summaryInstead of applying the patch, output a summary for the input
--checkInstead of applying the patch, see if the patch is applicable
--indexMake sure the patch is applicable to the current index
-N, --intent-to-addMark new files with `git add --intent-to-add`
--cachedApply a patch without touching the working tree
--unsafe-pathsAccept a patch that touches outside the working area
--applyAlso apply the patch (use with --stat/--summary/--check)
-3, --3wayAttempt three-way merge if a patch does not apply
--build-fake-ancestor <file>Build a temporary index based on embedded index information
-zPaths are separated with NUL character
-C <n>Ensure at least <n> lines of context match
--whitespace <action>Detect new or modified lines that have whitespace errors
--ignore-space-change, --ignore-whitespaceIgnore changes in whitespace when finding context
-R, --reverseApply the patch in reverse
--unidiff-zeroDon't expect at least one line of context
--rejectLeave the rejected hunks in corresponding *.rej files
--allow-overlapAllow overlapping hunks
-v, --verboseBe verbose
--inaccurate-eofTolerate incorrectly detected missing new-line at the end of file
--recountDo not trust the line counts in the hunk headers
--directory <root>Prepend <root> to all filenames