patch
all
Patch a file (or files) with a diff file. Note that diff files should be generated by the `diff` command.
More info →Options (3)
-o, --outputbooleanPatch a file writing the result to a different file
Example:
patch < {{patch.diff}} {{path/to/input_file}} {{[-o|--output]}} {{path/to/output_file}}-p, --stripbooleanApply a patch to the current directory
Example:
patch < {{patch.diff}} {{[-p|--strip]}} 1-R, --reversebooleanApply the reverse of a patch
Example:
patch < {{patch.diff}} {{[-R|--reverse]}}Examples (5)
Apply a patch using a diff file (filenames must be included in the diff file)
patch < patch.diffApply a patch to a specific file
patch < patch.diff path/to/filePatch a file writing the result to a different file
patch < patch.diff path/to/input_file [-o|--output] path/to/output_fileApply a patch to the current directory
patch < patch.diff [-p|--strip] 1Apply the reverse of a patch
patch < patch.diff [-R|--reverse]made by @shridhargupta | data from tldr-pages