Last active
April 26, 2016 05:07
-
-
Save cmthakur/4cd3cbe6c58188f0527225e788befc0a to your computer and use it in GitHub Desktop.
Repo synchronizer sync your all available repos under given directory with latest master
This file contains 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
project_dir = "my_code_hub" | |
repos = Dir["#{project_dir}/*"] | |
success_pull = repos.map do |rep_path| | |
response = `cd #{rep_path}; git checkout master; git pull`; | |
print '=>' | |
rep_path.split('/').last if response.length > 0 | |
end; | |
puts "#{success_pull.join(', ')} has been successfully pulled" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment