Hi
After you read this article, you’ll be able to apply patch files/diffs and deal with possible errors in the process.
Let’s assume the patch is in the file fix-bug.patch (the extension doesn’t matter). The directory software-1.0 contains the files to patch. Applying a patch file/diff then works like this:
- Make a backup. On Linux you can use the command:
markus@ubuntu:~$ cp -a software-1.0 software-1.0.before-patch - Run patch (for Windows: patch.exe) like this:
markus@ubuntu:~$ patch -Np1 -d software-1.0 < fix-bug.patch
Attention: this is patch minus N p digit one …, not minus N p small letter L!
» Read more: How to apply a patch/diff and solve “hunk FAILED”, “can’t find file to patch” and others