Skip to content

Instantly share code, notes, and snippets.

@amir-saniyan
Created September 29, 2024 13:38
Show Gist options
  • Save amir-saniyan/9663620bf97577c0b67617cc280165cc to your computer and use it in GitHub Desktop.
Save amir-saniyan/9663620bf97577c0b67617cc280165cc to your computer and use it in GitHub Desktop.
Pull all subdirectory repositories script (two level nested)
#!/usr/bin/env bash
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
cd "$SCRIPTPATH"
for dir in */ ; do
echo "$dir"
cd "$SCRIPTPATH/$dir"
if [[ ! -d ".git/" ]]
then
cd "$SCRIPTPATH/$dir/$dir"
fi
git pull
echo "################################################################################"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment