Code Patch production Record

Source: Internet
Author: User

Linux-diff and patch command making code patches tutorial

Linux-diff command can compare two different files and two directory differences to generate patch files

-R is a recursive option that sets this option, and diff will compare all of the corresponding files in the two different versions of the source code directory, including the subdirectory files.
The-n option ensures that the patch file will correctly handle the case where the file has been created or deleted.
The-u option creates a patch file in a uniform format that is more compact than the default format.

Diff-urn old/new/> Foo.patch

Linux-patch command to apply a patch file to another program directory

-P0 option to find the destination file (clip) from the current directory
-P1 option to ignore the first level of the directory, starting from the current directory to find.

Patch-p0 < Foo.patch


If we are in the process of developing the code to modify the bug or something, can be patched to save the form, and do not need to maintain a modified large source ...

Code Patch production Record

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.