Skip to content

Instantly share code, notes, and snippets.

@ajsharp
Created February 27, 2013 21:55
Show Gist options
  • Select an option

  • Save ajsharp/5052138 to your computer and use it in GitHub Desktop.

Select an option

Save ajsharp/5052138 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# Usage: ./script/pull-request
#
# Run this script after you've pushed your local branch to origin and you're
# ready to create a PR.
# install hub if not in user's $PATH
if `which hub`.chomp == ''
puts "`hub` not found, installing..."
system("gem install hub")
end
current_branch = `git branch | grep '\*' | awk '{print $2}'`.chomp
url = `hub pull-request -h zaarly:#{current_branch}`
# open the url in the browser
system "open #{url}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment