Skip to content

Instantly share code, notes, and snippets.

@xoebus
Created April 23, 2010 15:00
Show Gist options
  • Save xoebus/376617 to your computer and use it in GitHub Desktop.
Save xoebus/376617 to your computer and use it in GitHub Desktop.
Rakefile for managing lots of git repositories in one directory.
require "pathname"
GIT_REPOS = Dir["**/.git/.."].map { |path| path = Pathname.new(path).realpath }
desc "Update all repositories"
task :update do
GIT_REPOS.each do |repo|
command "git pull origin master", repo
end
end
def command(cmd, dir = ".")
Dir.chdir(dir) do
return `#{cmd}`.chomp
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment