how to push and set an upstream branch in git

I like to use hub, and mainly for creating pull requests in the console. To do so you have push and set an upstream branch: git push -u origin CURRENT_BRANCH_NAME. I found myself calling the remote branch the same as my local branch which became tedious so I created a shortcut: git pu.

Basic command
git rev-parse --abbrev-ref HEAD | xargs git push -u origin
Git alias
git config --global alias.pu \
'!sh -c "git rev-parse --abbrev-ref HEAD | xargs git push -u origin"'

Life can be much broader once you discover one simple fact: everything around that you call life, was made up by people no smarter than you.

-- Jobs