Quickly Apply Patches Using Git and curl or wget

24th December 2013

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 http://drupal.org/files/[patch-name].patch | git apply -v

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

$ wget -q -O - http://drupal.org/files/[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 Drupal.org.

About the Author

Picture of Oliver

Oliver Davies is a Web Developer, System Administrator and Drupal specialist based in the UK. He is a Senior Developer at Microserve and also provides freelance consultancy services for Drupal websites, PHP applications and Linux servers.

Drupal Association Individual Member
Acquia Certified Developer - Drupal 8 Exam Badge
Acquia Certified Back End Specialist - Drupal 8 Exam Badge

Availability

  • Currently have limited part-time capacity
  • Currently no spare full-time capacity.