Skip to content

Instantly share code, notes, and snippets.

@sheeeng
Created November 4, 2013 09:50
Show Gist options
  • Save sheeeng/7300390 to your computer and use it in GitHub Desktop.
Save sheeeng/7300390 to your computer and use it in GitHub Desktop.
Git pull for each first level child directory which is a Git repository.
for i in $(find . -maxdepth 1 -type d)
do
echo Found "$i" child directory.
cd $i
echo \$PWD is $PWD
if [ -d .git ]; then
echo "Git repository found."
git pull --verbose
else
echo "Sorry. This is not a Git repository."
fi
cd - > /dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment