zerodeviation.net - musings of an engineer, developer, and picky theologian

Technology

May 27, 2008

Updating tons of git repositories made easy

Tags: , ,

With git being the awesome version control system that it is, I switched to using git-svn for all our Web-Empowered Church extensions. That way I get the easy branching and merging while still being compatible with Subversion and everyone else who’s using it (and who hasn’t seen the light yet…).

Now I have a directory that contains all our wec_* extensions. With Subversion, I could do a simple “svn up *” and it would update all the working copies inside the subdirectories. Unfortunately, git doesn’t do that.

Ruby to the rescue:

!/usr/bin/env ruby

def rebase(dir) Dir.chdir(dir) do |path| puts "Rebasing #{path}...." git svn rebase puts "done!\n\n" end end

if ARGV[0].nil? dirs = Dir["*/"] dirs.each do |dir| rebase(dir) end else rebase ARGV[0] end

Just stuck this into the directory above all the extensions. Now I can rebase all extensions automatically with one little command, or just one by giving an optional argument.

Share this:
  • Digg
  • del.icio.us
  • Facebook
  • Twitter

No related posts.

  1. I was going to read this post, but then I saw git in the title and just gave up. Maybe I’ll see the light one day…

    Comment by Jeff Segars — May 27, 2008 @ 2:38 pm
  2. Yeah there’s hope for everyone in Christ ;)

    Comment by Christoph — June 14, 2008 @ 8:49 am

Leave a comment

RSS feed for comments on this post. TrackBack URL