Facilitate pushing current branch to origin
hammer opened this issue · 3 comments
hammer commented
When working on a branch I find myself doing $ git push origin <current-branch>
regularly. It's possible to retrieve <current-branch>
with $ git symbolic-ref --short HEAD
. I was thinking it could be handy to have a git-push-cb
helper that does $ git push origin
git symbolic-ref --short HEAD``. Does that seem reasonable?
ryan-williams commented
pretty reasonable! A couple of notes:
- This repo contains a
git current-branch
helper that is basically identical to yoursymbolic-ref
magic - this repo also contains
git push-to-origin-master
(akag pm
/gpm
), which pushes the current branch toorigin/master
. I use it pretty frequently, but it is slightly different from what you've requested here, so just to be clear, you want something that basically wrapsgit push origin "$(g cb)"
?
ryan-williams commented
how about: g po [optional branch name]
(git push-origin
, defaulting the branch name to current branch)? so your common case would just be gpo
or g po
hammer commented
yeah seems reasonable.