Skip to content

Instantly share code, notes, and snippets.

@ys
Created June 17, 2014 11:18
Show Gist options
  • Save ys/92566bfe2e34c222f5b5 to your computer and use it in GitHub Desktop.
Save ys/92566bfe2e34c222f5b5 to your computer and use it in GitHub Desktop.
#! /usr/bin/env ruby
issue= ARGV.shift
current_branch = `git rev-parse --abbrev-ref HEAD`
origin_url = `git config --get remote.origin.url`
repo = origin_url.split(':')[1].split('.')[0]
command = "hub pull-request"
command = command + " -i #{issue}" if issue
command = command + " -b #{repo}:master -h #{repo}:#{current_branch}"
system command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment