diff --git a/.bash_extra b/.bash_extra index cd4a6f4..e006b3e 100644 --- a/.bash_extra +++ b/.bash_extra @@ -150,11 +150,11 @@ EOF *) if [ ! -z $1 ] ; then (echo ">>> Try local checkout" && git checkout --quiet "$1" > /dev/null 2>&1) || - (echo ">>> Try remote checkout" && git checkout --quiet -b "$1" origin/"$1" > /dev/null 2>&1 || echo ">>> Unknown branch!") + (echo ">>> Try remote checkout" && git checkout --quiet -b "$1" origin/"$1" > /dev/null 2>&1 || echo ">>> Unkown branch!") else - echo ">>> get default branch" - default_branch=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p') - git checkout --quiet ${default_branch} > /dev/null 2>&1 + (git checkout --quiet master > /dev/null 2>&1 && echo '>>> Try checking out master') || + (git checkout --quiet main > /dev/null 2>&1 && echo '>>> Try checking out main') || + (git checkout --quiet release > /dev/null 2>&1 && echo '>>> Try checking out release') fi esac }