Skip to content

Instantly share code, notes, and snippets.

@cmthakur
Last active April 26, 2016 05:07
Show Gist options
  • Save cmthakur/4cd3cbe6c58188f0527225e788befc0a to your computer and use it in GitHub Desktop.
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
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