Skip to content

Instantly share code, notes, and snippets.

@pasdam
Last active April 25, 2023 08:40
Show Gist options
  • Save pasdam/b30d7658cfeb3a49ec2e7e3f3aa47415 to your computer and use it in GitHub Desktop.
Save pasdam/b30d7658cfeb3a49ec2e7e3f3aa47415 to your computer and use it in GitHub Desktop.
#!/bin/sh
DIR=$1
if [ -z "$DIR" ]; then
DIR=./
fi
if [ ! -d "$DIR" ]; then
1>&2 echo "Invalid dir: $DIR"
exit 1
fi
echo "Processing files in $DIR"
cd $DIR
for i in *; do
echo ""
echo "============================================"
echo "Pulling: $i"
cd $i
git pull
git fetch --prune origin
cd $DIR
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment