Created
July 21, 2015 09:29
-
-
Save robinwo/9d615fc3e1773ea4771b to your computer and use it in GitHub Desktop.
Pull local git repos, checkout master
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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