Skip to content

Instantly share code, notes, and snippets.

@dwaynemac
Created October 13, 2011 14:39
Show Gist options
  • Save dwaynemac/1284367 to your computer and use it in GitHub Desktop.
Save dwaynemac/1284367 to your computer and use it in GitHub Desktop.
Shell scripts to manage multiple projects with git
#!/usr/bin/env ruby
Dir['*/'].each do |dir|
puts "fetching #{dir.gsub("/","")} origin"
puts `cd #{dir} && git fetch origin`
end
#!/usr/bin/env ruby
Dir['*/'].each do |dir|
output = `cd #{dir} && git status`
if output =~ /nothing to commit/
puts "#{dir.gsub("/","")}: clean"
else
puts "==> #{dir.gsub("/","")}: DIRTY!"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment