Skip to content

Instantly share code, notes, and snippets.

@doyle
Created May 7, 2019 18:16
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 doyle/7b080340a95194c9c52ba136427a5468 to your computer and use it in GitHub Desktop.
Save doyle/7b080340a95194c9c52ba136427a5468 to your computer and use it in GitHub Desktop.
Pushes the current branch to git hub and opens the PR in your browser
#!/bin/sh
# pushes the current branch to git hub and opens your browser to the
# pull request page for the current branch
OUTPUT=`(git push origin HEAD) 2>&1`
URL=`echo $OUTPUT | sed -e 's/.*visiting: remote: \(https:\/\/github.com[A-Za-z0-9%\/_-]*\).*/\1/'`
echo opening $URL
open $URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment