Development:How to apply a patch
From MoodleDocs
Introduction
Apply a Patch in Windows using gnuwin32
- Download and extract patch for windows from [1] I placed the patch.exe binary in C:\bin
- Download and extract Moodle somewhere. eg: C:\moodle
- Download the patch file and place it in the same directory you put Moodle (C:\moodle\password-policy-17.diff)
- Open the patch file with Wordpad, and click 'File' >> 'Save as...', choose a different name for the file eg ('mynewpatch.diff') and "Save as type" >> 'Text Document - MS-DOS Format'
- Open up a command text window, and type:
cd \moodle c:\bin\patch.exe -p1 < mynewpatch.diff
- You should get an output similar to this:
patching file admin/settings/security.php patching file lang/en_utf8/admin.php patching file lib/moodlelib.php patching file login/change_password.php patching file login/signup.php patching file user/edit.php Hunk #1 succeeded at 430 (offset 2 lines).
Apply a Patch in Linux using "patch"
use something like: patch -p1 < patchfile.diff