Created
July 19, 2020 11:02
-
-
Save MarkWarneke/6a000ed9f3134b838297076a257f2224 to your computer and use it in GitHub Desktop.
A quick and dirty folder based script to pull & prune all repositories in the current folder
This file contains hidden or 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
#!/bin/bash | |
BASEDIR=$(sh -c pwd) | |
for foldername in */; do \ | |
cd $foldername && \ | |
branch=$(git rev-parse --abbrev-ref HEAD) && \ | |
echo "======= Pulling $foldername --- branch: $branch =======" && \ | |
git pull && \ | |
git remote prune origin | |
cd $BASEDIR | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment