---------------- NEEDS TO BE EXPANDED/REVIEWED ----------------------
Applying patches, modifying files according to instructions in the patch file, is the domain of patch programs. There are many different programs with this functionality. some stand-alone (patch), some integrated in IDE's (Eclipse, XCode).
Warning: Patching is something that should never be done on your production site unless you have sufficient backup and testing performed. While patching itself is relatively easy, understanding the implications of a patch is not. Patching your system can lead to loss of data and/or site instabilities
This page only deals with some basic principles using the command line utility
patch. Patch can be found on most UNIX systems and is included in the packages UnxUtils and Cygwin for use on Windows.
Provided that the patch was made relative to the ProjectPier root directory, navigate to the ProjectPier directory (using
cd) and issue the command:
patch -p0 < path/file.patch
If the patch was not made relative to the ProjectPier root directory you can place the patch in the same directory as the file being patched and run the patch command without the -p option. To do so,
cd to the directory and type:
patch < file.patch
Patch will usually auto-detect the format. You can also use the
-u command line option to indicate a unified patch, and the
-b option creates a backup copy of the file before modifying it. In case of problems, you can then easily restore the backup file.
You can also reverse the patch if you want to.