Skip to content

Instantly share code, notes, and snippets.

@ebonical
Created October 11, 2010 18:50
Show Gist options
  • Save ebonical/621017 to your computer and use it in GitHub Desktop.
Save ebonical/621017 to your computer and use it in GitHub Desktop.
git push shortcut
#!/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