Skip to content

Instantly share code, notes, and snippets.

@kraigh
Created May 21, 2015 20:48
Show Gist options
  • Save kraigh/2d3ff09b37dfdf0669cc to your computer and use it in GitHub Desktop.
Save kraigh/2d3ff09b37dfdf0669cc to your computer and use it in GitHub Desktop.
github pull request helper
#!/usr/bin/env bash
branch=$(git symbolic-ref --short HEAD)
remote=$(git config --get remote.origin.url)
url=${remote/git\@github\.com\:/https://github.com/}
url=${url/\.git/\/compare/}
base=
while getopts b: opt; do
case $opt in
b)
base="$OPTARG..."
;;
esac
done
url=$url$base$branch
open $url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment