tldr/pages/common/patch.md

17 lines
321 B
Markdown
Raw Normal View History

2015-10-22 10:31:52 +03:00
# patch
2014-10-25 15:20:07 +04:00
> Patch a file (or files) with a diff file.
> Note that diff files contain both the target filenames and list of changes.
2014-10-25 15:20:07 +04:00
- Apply a patch:
2014-10-25 15:20:07 +04:00
`patch < {{patch_file}}.diff`
2014-10-25 15:20:07 +04:00
- Apply a patch to current directory:
2014-10-25 15:20:07 +04:00
`patch -p1 < {{patch_file}}.diff`
2014-10-25 15:20:07 +04:00
- Apply the reverse of a patch:
2014-10-25 15:20:07 +04:00
`patch -R < {{patch_file}}.diff`