-
-
Save ebonical/621017 to your computer and use it in GitHub Desktop.
git push shortcut
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -wKU | |
def push_branch(branch) | |
puts "pushing branch: #{branch}" | |
`git push origin #{branch}` | |
end | |
if branch = ARGV[0] | |
push_branch(branch) | |
else | |
branches = `git branch` | |
branches.each do |branch| | |
if branch.match(/\A\* (.*)\Z/) | |
push_branch($1) | |
break | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment