diff --git a/git_co_all_branches.sh b/git_co_all_branches.sh index 199e137..58aafc8 100755 --- a/git_co_all_branches.sh +++ b/git_co_all_branches.sh @@ -1,12 +1,13 @@ #!/bin/bash +activebranch="$(/usr/bin/git branch | /bin/grep "\*" | awk '{print $2}')" echo "============= GIT CO BRANCHES =============" -for f in $(git br -a | grep remotes | grep -v "remotes/origin/HEAD" | awk '{print $1}' | cut -f3 -d\/) +for f in $(/usr/bin/git branch -a | /bin/grep remotes | /bin/grep -v "remotes/origin/HEAD" | awk '{print $1}' | cut -f3 -d\/) do echo "Checkout: ${f}" - git checkout "${f}" --quiet + /usr/bin/git checkout "${f}" --quiet done +/usr/bin/git checkout "${activebranch}" --quiet echo "===========================================" -