Last active
December 26, 2015 03:39
-
-
Save revans/7086989 to your computer and use it in GitHub Desktop.
Git Extension for easily pulling down specific Pull Requests from github or setting your local repository to access all Pull Requests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
arg=$1 | |
function specific_pull_request() { | |
echo "Fetching Pull Request '${arg}' from Github..." | |
git fetch origin pull/$arg/head:pr-$arg | |
} | |
function generic_pull_request() { | |
echo "Setting up your local Git repo to be able to pull all Pull Requests from Github." | |
git config --add remote.origin.fetch '+refs/pull/*/head:refs/remotes/origin/pr/*' | |
} | |
case $arg in | |
''|*[!0-9]*) generic_pull_request ;; | |
*) specific_pull_request ;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment