Updating the git repos in current dir
I’ve been using more and more git based TextMate bundles of late and updating them can be a bit of a pain. Mainly because you have to remember which ones are git ones, not too bad you can check for a .git directory in the bundles.
So I finally go round to slapping together a small script to do this for me. I give you ~/bin/update-git-repos
#!/bin/sh
find . -name ".git" -depth 2 -type d -print | while read i; do
pushd "`dirname "$i"`"
git pull
popd
done
and this is an I think improvement as it moves the dirname call out of the while
#!/bin/sh
find . -name ".git" -depth 2 -type d -exec dirname {} ";" | while read i; do
pushd "$i"
git pull
popd
done
well I hope that helps some one else. I’m pretty sure I’ve read something like this before for updating your git TextMate bundles but for the life of me I couldn’t find it. Things like find, git, update, repos, pull none of them in assorted combinations turned up what I want. Now with luck they will.