What's a patch? Say you've got a file, let's use the /etc/exim.conf as an example, and you need to make changes to that file many times over.
This may be the case if you have many servers, and you want all of them to have the same changes made.
The best way to make the same changes to the exim.conf, but to also allow the default exim.conf to have differences in other areas, is to use a patch.
Creating a patch
To create a patch, first copy your original:
cp exim.conf exim.conf.orig
Now manually make all the changes you want to your exim.conf:
Create the patch:
diff -u exim.conf.orig exim.conf > exim.conf.patch
You've now got a patch file which can be applied to the original exim.conf for other systems, or if you re-install, etc..
Save it to a location on your website so it can be downloaded to other servers.
Applying your patch
You've got a patch file, and your default exim.conf, and your want your changes to be applied.
Save the patch beside the file:
Apply the patch:
patch -p0 < exim.conf.patch
and you're done.
Your patched exim.conf should now have all of the changes that were manually done to the original.