Skip to content

Instantly share code, notes, and snippets.

@edelbalso
Forked from dwaynemac/.gitignore
Created July 23, 2016 21:20
Show Gist options
  • Save edelbalso/5f94117db7c127e0b7758961514c7b8d to your computer and use it in GitHub Desktop.
Save edelbalso/5f94117db7c127e0b7758961514c7b8d 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