Skip to content

Instantly share code, notes, and snippets.

@tadelv
Created April 23, 2010 14:25
Show Gist options
  • Save tadelv/376582 to your computer and use it in GitHub Desktop.
Save tadelv/376582 to your computer and use it in GitHub Desktop.
require "rubygems"
#list through the current folder and call git pull on each repository
home = ARGV[0] == nil ? Dir.pwd : ARGV[0]
home_d = Dir.open(home)
home_count = home_d.count
c_idx = 1
home_d.each do |current|
c_dir = "#{home}/#{current}"
if File::directory?(c_dir) && current != ".." && current != "."
Dir.chdir("#{home}/#{current}")
if File::exists?(".git")
puts "="*80
puts "pulling #{current}"
system("git pull")
end
#print("\r","="*c_idx,"#{c_idx}/#{home_count}")
Dir.chdir(home)
c_idx += 1
end
end
puts
puts "all done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment