Skip to content

Instantly share code, notes, and snippets.

@rstormsf
Created September 28, 2015 20:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rstormsf/67d3df851e7476da833e to your computer and use it in GitHub Desktop.
Save rstormsf/67d3df851e7476da833e to your computer and use it in GitHub Desktop.
git pull all directories
#!/bin/ruby
Dir.chdir(Dir.home + '/repos/all')
dirs = Dir.entries('.').select {|entry| File.directory? File.join('.', entry) and !(entry =='.' || entry == '..') }
dirs.each do |d|
Dir.chdir("#{Dir.pwd + '/' + d}")
puts Dir.pwd
system "git pull"
Dir.chdir(Dir.pwd + "/../")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment