GNU Info

Info Node: (diff.info)Invoking patch

(diff.info)Invoking patch


Next: Invoking sdiff Prev: Invoking diff3 Up: Top
Enter node , (file) or (file)node

Invoking `patch'
****************

   Normally `patch' is invoked like this:

     patch <PATCHFILE

   The full format for invoking `patch' is:

     patch OPTIONS... [ORIGFILE [PATCHFILE]] [+ OPTIONS... [ORIGFILE]]...

   If you do not specify PATCHFILE, or if PATCHFILE is `-', `patch'
reads the patch (that is, the `diff' output) from the standard input.

   You can specify one or more of the original files as ORIG arguments;
each one and options for interpreting it is separated from the others
with a `+'.  Note: Multiple Patches, for more information.

   If you do not specify an input file on the command line, `patch'
tries to figure out from the "leading text" (any text in the patch that
comes before the `diff' output) which file to edit.  In the header of a
context or unified diff, `patch' looks in lines beginning with `***',
`---', or `+++'; among those, it chooses the shortest name of an
existing file.  Otherwise, if there is an `Index:' line in the leading
text, `patch' tries to use the file name from that line.  If `patch'
cannot figure out the name of an existing file from the leading text,
it prompts you for the name of the file to patch.

   If the input file does not exist or is read-only, and a suitable RCS
or SCCS file exists, `patch' attempts to check out or get the file
before proceeding.

   By default, `patch' replaces the original input file with the
patched version, after renaming the original file into a backup file
(Note: Backups, for a description of how `patch' names backup files).
You can also specify where to put the output with the `-o OUTPUT-FILE'
or `--output=OUTPUT-FILE' option.

patch Directories
Changing directory and stripping directories.
Backups
Backup file names.
Rejects
Reject file names.
patch Options
Summary table of options to `patch'.

automatically generated by info2www version 1.2.2.9