Last Updated: February 25, 2016
·
4.805K
· catchamonkey

git push current branch

I have this as a bash alias, but you can run however you want.

git push origin `git rev-parse --abbrev-ref HEAD`

Pushes current branch to a remote called origin (and remote branch of same name as local)

2 Responses
Add your response

I think you can just execute this command git push origin HEAD

over 1 year ago ·

You can also set this as the default by setting push.default to upstream http://www.kernel.org/pub/software/scm/git/docs/git-config.html so that git push will push the current branch to its upstream

over 1 year ago ·