git helper for long branch names
Stole this idea from Giles Bowkett. Create a bash or zsh function called this for fast easy pushes of topic branches with long names a'la:
$ git push origin `this`
bash:
function this(){
if [[ -d '.git' ]]; then
git branch | grep \* | cut -d ' ' -f 2
fi
}
zsh (may require git plugin, still new to zsh):
this() { if [[ -d '.git' ]] then; current_branch; fi }
Written by Keith
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Zsh
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#