Skip to main content

Quickly Apply Patches Using Git and curl or wget

Warning: This post is over a year old. I don't always update old posts with new information, so some of this information may be out of date.

Testing a patch file is usually a two-step process. First you download the patch file from the source, and then you run a separate command to apply it.

You can save time and typing by running the two commands on one line:

$ curl[patch-name].patch | git apply -v

Or, if you don't have curl installed, you can use wget:

$ wget -q -O -[patch-name].patch | git apply -v

These commands need to be run within the root of your Git repository (i.e. where the .git directory is).

These snippets were taken from Applying Patches with Git on