Created
April 23, 2010 15:00
-
-
Save xoebus/376617 to your computer and use it in GitHub Desktop.
Rakefile for managing lots of git repositories in one directory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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