Skip to content

Instantly share code, notes, and snippets.

@valarpirai
Created December 17, 2018 05:53
Show Gist options
  • Save valarpirai/b160f62859ef531a91de573cf2e03e35 to your computer and use it in GitHub Desktop.
Save valarpirai/b160f62859ef531a91de573cf2e03e35 to your computer and use it in GitHub Desktop.
Iterate over the git repositories in current directory and do git pull
find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "pull()
{
echo '--------- $(pwd)'
if [ -d \".git\" ]; then
echo '######### Start git pull'
git pull
else
echo '********* Not a git Repo **********'
fi
}
cd '{}' && pull" \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment