I am making an assumption here that you already know the normal forward-usage of the patch command. If you’re unversed In case you didn’t want to decipher the entire man page just yet, you’re in luck. I came across an instance where I had to remove a previous patch file from the Magento Enterprise code-base. The patch was originally applied as so:

patch -p0 < firstpatch.patch

Problems ensued, and I was given a new patch, however it was a cumulative patch so it couldn’t be laid over the first patch. So how to remove? After a man-page reading, it’s quite a breeze. You need the original patch to be removed, and use the patch number you used in the first patching instance. In this case it equates to the following:

patch -R -p0 < firstpatch.patch

now you can add the new patch.

patch -p0 < secondpatch.patch

Hopefully this will save someone a man-page reading on a small terminal in a dimly lit server room. :-)

Comment now!
















Trackbacks