Skip to content

Instantly share code, notes, and snippets.

@mertkahyaoglu
Forked from cam8001/dapply
Created February 6, 2019 10:47
Show Gist options
  • Save mertkahyaoglu/2459be3a8bc1eebc53d93fd8eef06b5d to your computer and use it in GitHub Desktop.
Save mertkahyaoglu/2459be3a8bc1eebc53d93fd8eef06b5d to your computer and use it in GitHub Desktop.
Apply a patch directly from a URL without downloading it first.
#!/bin/bash
# Downloads and applies a patch from Drupal.org.
if [ -z "$1" ]
then
echo "You need to supply a URL to a patch file."
exit
fi
URL=$1;
# Download a patch and apply it.
curl $URL | git apply -v --index
# Commit patch and add a log message.
git commit -m "Applied $URL."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment