drupal patch

You can patch drupal file, or any other file
with a txt file named something.patch
copy file to a root directory of file to be patched, and run this command
patch -p1 < something.patch

The -p option tells patch how many leading prefixes to strip. For patches created using git, -p1 is normally the right option, and is the default for git apply. If that doesn't work, try either of the above commands with -p0 instead.