Created
June 22, 2022 20:32
-
-
Save bvanskiver/d2a735dcd33a19bec074a8cfbc61b876 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pull latest on all repos | |
for d in */; do | |
cd "$d" && echo "*********** $d ***********" && | |
if [ -d .git ]; then | |
git pull | |
else | |
echo "Not a git repository, skipping."; | |
fi | |
cd .. && echo | |
done | |
# Show git status on all repos | |
for d in */; do | |
cd "$d" && echo "*********** $d ***********" && | |
if [ -d .git ]; then | |
git status | |
else | |
echo "Not a git repository, skipping."; | |
fi | |
cd .. && echo | |
done | |
# Switch all repos to main branch | |
for d in */; do | |
cd "$d" && echo "*********** $d ***********" && | |
if [ -d .git ]; then | |
git checkout main | |
else | |
echo "Not a git repository, skipping."; | |
fi | |
cd .. && echo | |
done | |
# Show local branches on all repos | |
for d in */; do | |
cd "$d" && echo "*********** $d ***********" && | |
if [ -d .git ]; then | |
git branch | |
else | |
echo "Not a git repository, skipping."; | |
fi | |
cd .. && echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment