ryan-williams/git-helpers

Facilitate pushing current branch to origin

hammer opened this issue · 3 comments

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?

pretty reasonable! A couple of notes:

  • This repo contains a git current-branch helper that is basically identical to your symbolic-ref magic
  • this repo also contains git push-to-origin-master (aka g pm / gpm), which pushes the current branch to origin/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 wraps git push origin "$(g cb)"?

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

yeah seems reasonable.