My favorite bash git alias

gpob(){
	gb=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/")
	git push origin $gb
}

Stands for “git push origin branch” and it automatically pushes current commits to the currently checked out branch.

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *