Created
September 28, 2015 20:32
-
-
Save rstormsf/67d3df851e7476da833e to your computer and use it in GitHub Desktop.
git pull all directories
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
#!/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