Automating my workflow

I wanted to share a shell script I wrote recently. Finished product first:

I have a directory containing several git repositories that I have to bring up to date with some frequency. I found myself doing a git pull for each of those repositories and sometimes I'd forget one. Why not automate this?

I now type sh in my OSX terminal and all my repositories are brought up to date! This also does a git fetch -p to do some pruning.

All the fetching done by one script

Feel free to copy this script — do remember to replace Workspace with the name of the directory containing your own repositories, and maybe replace the names in the DIRS array with your own repositories.

Do you have scripts like this yourself? Leave a comment!