Skip to content

Instantly share code, notes, and snippets.

@flooose
Created February 4, 2011 09:43
Show Gist options
  • Select an option

  • Save flooose/810930 to your computer and use it in GitHub Desktop.

Select an option

Save flooose/810930 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# update the local repositories if needed
if [ $REPOSITORIES ]; then
echo "Updating local repositories"
for REPOSITORY in `ls ${REPOSITORIES}`; do
echo "${REPOSITORY}: "
( cd ${REPOSITORIES}/$REPOSITORY; git clean -fdx; git pull; git reset --hard HEAD )
done
echo "Done updating `ls ${REPOSITORIES} | wc -l` local repositories"
else
echo 'You need to specify the $REPOSITORIES environment-variable.'
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment