git-scripts/git_co_all_branches.sh

14 lines
438 B
Bash
Executable File

#!/bin/bash
activebranch="$(/usr/bin/git branch | /bin/grep "\*" | awk '{print $2}')"
echo "============= GIT CO BRANCHES ============="
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}"
/usr/bin/git checkout "${f}" --quiet
done
/usr/bin/git checkout "${activebranch}" --quiet
echo "==========================================="