Skip to content

Instantly share code, notes, and snippets.

@saagarjha
Last active April 1, 2017 17:22
Show Gist options
  • Save saagarjha/a1e3ffce33cea29f30911929025dfce2 to your computer and use it in GitHub Desktop.
Save saagarjha/a1e3ffce33cea29f30911929025dfce2 to your computer and use it in GitHub Desktop.
Try out Git pull requests locally
#!/bin/sh
if [ $# == 1 ]; then
git fetch origin pull/$1/head:pr-$1
git checkout pr-$1
elif [ $# == 2 ]; then
git fetch $1 pull/$2/head:pr-$2
git checkout pr-$2
else
echo "Usage: git test-pr [remote] pr#"
false
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment