Updating Multiple Git Repos

Adam Lowe has a great writeup on setting up Vim for Ruby/Rails work.  It’s a pretty great solution, using pathogen.vim and the git repos for the bundles, but he didn’t mention how to update your bundles in an easy manner…

$ find . -name ".git"  -type d -prune -execdir git pull \;

This is a little command line snippet that will search for git repositories in all of the subdirectories of wherever you run it and update them.  Really handy in this case, because you can update all of your bundles at once, but it will work in any case where you have cloned a bunch of repos and want them to all stay up to date.

, ,

  1. #1 by Adam Lowe on January 29th, 2010

    Thanks for the mention and the follow up script. I generally don’t blanket update my plugins. Usually I just use

    $ git pull –rebase

    on individual plugins when there is an update I want to pull down.

  2. #2 by Jon Swope on January 29th, 2010

    Indeed, that is likely many people’s usage. I just wanted a quick way to do a blanket update that I could run periodically, since I’m pretty bad at keeping up with the actual changes in the bundles.

  3. #3 by Notger on January 27th, 2012

    Thanks for the hint, very useful on my linux machine, but on my windows machine with git, it does not work.
    It says “invalid predicate execdir”. Any idea?
    (find only seems to know exec which does not execute in the correct directory.)

(will not be published)

  1. No trackbacks yet.