From 622bb526520a75d2581b249d26377e09353e531f Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 25 Jul 2022 19:14:38 +0200 Subject: [PATCH] bash: gc: ersetze Variable durch subshell --- .bash_extra | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.bash_extra b/.bash_extra index 672165b..b7d13be 100644 --- a/.bash_extra +++ b/.bash_extra @@ -182,15 +182,14 @@ Author: EOF ;; --new-branch | -b) - REMOTE=$(git remote | head -n 1) - (git checkout --quiet -b "$2" && git push --set-upstream "$REMOTE" "$2" && echo '>>> Create new branch "'"$2"'"') || + (git checkout --quiet -b "$2" && git push --set-upstream "$(git remote | head -n 1)" "$2" && echo '>>> Create new branch "'"$2"'"') || (git checkout --quiet "$2" > /dev/null 2>&1 && echo '>>> Branch already exists, checking out... ') ;; *) (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 ">>> Unkown branch!") esac -} +} ### Aliase # tmux alias tmuxa="tmux a -t "