#!/bin/sh # # Makes push "just work" by only pushing the current branch to origin. # branch_name=$(git symbolic-ref --quiet HEAD) if [[ $? -ne 0 ]] ; then echo "Not on a branch" exit 1 fi branch_name=${branch_name/refs\/heads\//} git push origin $branch_name if [[ $? -ne 0 ]] ; then exit $? fi # ...tags...