Skip to content

Instantly share code, notes, and snippets.

@hiquest
Created April 28, 2015 14:46
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 hiquest/3350ede53e80c4326c96 to your computer and use it in GitHub Desktop.
Save hiquest/3350ede53e80c4326c96 to your computer and use it in GitHub Desktop.
Make a pull request from command line (OSX ready)
#!/bin/sh
# This will open a browser window with pull-request
set -e
project=`git remote -v | grep origin | head -n 1 | awk '{print $2}' | sed 's/.*github.com.//' | sed 's/\.git//'`
branch=`git rev-parse --abbrev-ref HEAD`
url="https://github.com/$project/compare/$branch?expand=1"
open $url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment