Skip to content

Instantly share code, notes, and snippets.

@EdoardoVignati
Created May 7, 2024 22:22
Show Gist options
  • Save EdoardoVignati/6078922ee29e26813034ffe935be2800 to your computer and use it in GitHub Desktop.
Save EdoardoVignati/6078922ee29e26813034ffe935be2800 to your computer and use it in GitHub Desktop.
Track all the Git branches of all repositories
for folder in $(ls -d */); do
cd $folder
echo
echo ===========================
echo $folder
echo ===========================
for branch in $(git branch -r | grep -v HEAD | cut -d / -f 2,3,4,5); do
echo
echo "=>" $branch
git checkout $branch
git checkout .
git pull --rebase
done
cd ..
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment