Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

push unpushed branches

  • Loading branch information...
commit 2b087b0de25801d6b15c3fd992f5aea5596ccb8e 1 parent aec5040
@grosser authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 bin/git-pull-request
View
7 bin/git-pull-request
@@ -4,4 +4,11 @@ remote = remotes.detect{|l| l.start_with?("origin\t") }
url = remote.split(" ")[1]
repo = url[%r{(\w+/\w+)\.git}i, 1]
branch = `git rev-parse --abbrev-ref HEAD`.strip
+
+# push branch if it is not yet on origin
+unless system("git show origin/#{branch} 2>&1 > /dev/null")
+ puts "pushing #{branch} to origin"
+ `git push -u origin #{branch}`
+end
+
exec %Q{open "https://github.com/#{repo}/pull/new/#{branch}"}
Please sign in to comment.
Something went wrong with that request. Please try again.