Skip to content

Instantly share code, notes, and snippets.

@tapajos
Last active August 29, 2015 13:56
Show Gist options
  • Save tapajos/9308364 to your computer and use it in GitHub Desktop.
Save tapajos/9308364 to your computer and use it in GitHub Desktop.
function update_all {
cd $PROJECTS_PATH
for i in $(find . -type d); do
if [ -d "$i/.git" ]; then
echo -e "\033[1mPulling "$i"\033[0m"
cd "$i"
# pull repos without local changes
if git diff-index --quiet HEAD --; then
git pull --rebase --quiet > /dev/null
if [ -e Gemfile ]; then
bundle --local --quiet > /dev/null
fi
git remote prune origin > /dev/null
git gc --quiet > /dev/null
fi
cd - > /dev/null
fi
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment