Wednesday, February 18, 2009

Creating and applying Patch

  • Create Patch
diff -urN orignalsource updatedsource > file.patch
The above command will create a patch by going recursively through the source and destination.
The option 'N' tells to treat the new files as empty files in the other directory

  • Apply Patch
patch --dry-run -p1 < ../file.patch
The above command will run through the patch without applying it and giving information which will be given when the patch would actually will be applied.

patch -p1 < ../file.patch
This would actually apply the patch

No comments:

Post a Comment

Followers