diffutils: Merging with patch

1 
1 10 Merging with 'patch'
1 ***********************
1 
1 'patch' takes comparison output produced by 'diff' and applies the
1 differences to a copy of the original file, producing a patched version.
1 With 'patch', you can distribute just the changes to a set of files
1 instead of distributing the entire file set; your correspondents can
1 apply 'patch' to update their copy of the files with your changes.
1 'patch' automatically determines the diff format, skips any leading or
1 trailing headers, and uses the headers to determine which file to patch.
1 This lets your correspondents feed a mail message containing a
1 difference listing directly to 'patch'.
1 
1    'patch' detects and warns about common problems like forward patches.
1 It saves any patches that it could not apply.  It can also maintain a
1 'patchlevel.h' file to ensure that your correspondents apply diffs in
1 the proper order.
1 
1    'patch' accepts a series of diffs in its standard input, usually
1 separated by headers that specify which file to patch.  It applies
1 'diff' hunks (⇒Hunks) one by one.  If a hunk does not exactly
1 match the original file, 'patch' uses heuristics to try to patch the
1 file as well as it can.  If no approximate match can be found, 'patch'
1 rejects the hunk and skips to the next hunk.  'patch' normally replaces
1 each file F with its new version, putting reject hunks (if any) into
1 'F.rej'.
1 
1    ⇒Invoking patch, for detailed information on the options to
1 'patch'.
1 

Menu