Skip to content

Instantly share code, notes, and snippets.

@matthiasbeyer
Created April 13, 2019 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthiasbeyer/2b193bca7912176801aa31990ad60014 to your computer and use it in GitHub Desktop.
Save matthiasbeyer/2b193bca7912176801aa31990ad60014 to your computer and use it in GitHub Desktop.
A script to apply github PRs as one commit
#!/usr/bin/env bash
while read line
do
patch=$(echo "$line" | sed
's,github\.com,patch-diff.githubusercontent.com/raw,; s,$,.patch,')
prnr=$(echo "$line" | sed 's,.*/,,')
curl $patch | git am -s || exit 1
echo "Closes #$prnr"
done < "${1:-/dev/stdin}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment