From 9dc37c67cc6c9aea70fccf42ec040ca605cd9881 Mon Sep 17 00:00:00 2001 From: mg Date: Thu, 21 Dec 2023 13:27:09 +0100 Subject: [PATCH] revert 95a549248381089edbb4a1957b3d2101974ca378 revert bash: gc: set default branch programatically Signed-off-by: Michael Grote --- .bash_extra | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 }