Skip to content

Instantly share code, notes, and snippets.

@robinwo
Created July 21, 2015 09:29
Show Gist options
  • Select an option

  • Save robinwo/9d615fc3e1773ea4771b to your computer and use it in GitHub Desktop.

Select an option

Save robinwo/9d615fc3e1773ea4771b to your computer and use it in GitHub Desktop.
Pull local git repos, checkout master
#!/bin/zsh
## pull git repos
cd /Users/dev/repos ; # Update this path
echo ":::: Updated cloned git repositories ::::" ;
for i in * ;
do if [ -d $i ] ;
then echo "::: Directory $i :::" ;
cd $i ;
# Pull repo
git pull ;
# Smart disk usage
git gc --auto;
# Checkout master
git checkout master
# Pause a few secs
sleep 2;
cd .. ;
fi
done ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment