Last Updated: February 25, 2016
· 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 so that git push will push the current branch to its upstream

over 1 year ago ·