mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 00:42:08 +02:00
patch: correct and add examples. (#3092)
This commit is contained in:
parent
21ca990661
commit
578a36f657
1 changed files with 14 additions and 6 deletions
|
@ -1,16 +1,24 @@
|
|||
# patch
|
||||
|
||||
> Patch a file (or files) with a diff file.
|
||||
> Note that diff files contain both the target filenames and list of changes.
|
||||
> Note that diff files should be generated by the `diff` command.
|
||||
|
||||
- Apply a patch:
|
||||
- Apply a patch using a diff file (filenames must be included in the diff file):
|
||||
|
||||
`patch < {{patch_file}}.diff`
|
||||
`patch < {{patch.diff}}`
|
||||
|
||||
- Apply a patch to current directory:
|
||||
- Apply a patch to a specific file:
|
||||
|
||||
`patch -p1 < {{patch_file}}.diff`
|
||||
`patch {{path/to/file}} < {{patch.diff}}`
|
||||
|
||||
- Patch a file writing the result to a different file:
|
||||
|
||||
`patch {{path/to/input_file}} -o {{path/to/output_file}} < {{patch.diff}}`
|
||||
|
||||
- Apply a patch to the current directory:
|
||||
|
||||
`patch -p1 < {{patch.diff}}`
|
||||
|
||||
- Apply the reverse of a patch:
|
||||
|
||||
`patch -R < {{patch_file}}.diff`
|
||||
`patch -R < {{patch.diff}}`
|
||||
|
|
Loading…
Add table
Reference in a new issue