2015-03-16 21:18:03 +00:00
|
|
|
---
|
|
|
|
title: Quickly Apply Patches Using Git and curl or wget
|
2020-03-08 14:32:13 +00:00
|
|
|
date: 2013-12-24
|
2020-03-08 17:52:59 +00:00
|
|
|
excerpt:
|
|
|
|
How to quickly download a patch file and apply it to a Git repository in one
|
|
|
|
line
|
2015-03-16 21:18:03 +00:00
|
|
|
tags:
|
2015-06-14 02:27:41 +00:00
|
|
|
- git
|
|
|
|
- drupal-planet
|
2015-03-16 21:18:03 +00:00
|
|
|
---
|
2020-03-08 17:52:59 +00:00
|
|
|
|
|
|
|
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.
|
2015-06-18 00:52:29 +00:00
|
|
|
|
|
|
|
You can save time and typing by running the two commands on one line:
|
|
|
|
|
2017-03-16 08:09:52 +00:00
|
|
|
```language-bash
|
|
|
|
$ curl http://drupal.org/files/[patch-name].patch | git apply -v
|
|
|
|
```
|
2015-03-16 21:18:03 +00:00
|
|
|
|
|
|
|
Or, if you don't have curl installed, you can use wget:
|
|
|
|
|
2017-03-16 08:09:52 +00:00
|
|
|
```language-bash
|
|
|
|
$ wget -q -O - http://drupal.org/files/[patch-name].patch | git apply -v
|
|
|
|
```
|
2015-03-16 21:18:03 +00:00
|
|
|
|
2020-03-08 17:52:59 +00:00
|
|
|
These commands need to be run within the root of your Git repository (i.e. where
|
|
|
|
the .git directory is).
|
2015-03-16 21:18:03 +00:00
|
|
|
|
2020-03-08 17:52:59 +00:00
|
|
|
These snippets were taken from
|
|
|
|
[Applying Patches with Git](https://drupal.org/node/1399218) on Drupal.org.
|