Created
September 5, 2008 04:08
-
-
Save mislav/8920 to your computer and use it in GitHub Desktop.
a utility to execute commands entered in the console in several git repositories at once
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
#!/usr/bin/env ruby | |
# for each git repo in a subdirectory ... | |
dirs = Dir['**/.git'].map { |gd| File.dirname(gd) } | |
def prompt | |
print ">> " | |
gets | |
end | |
# ... execute a command given on STDIN | |
while command = prompt | |
dirs.each do |dir| | |
Dir.chdir(dir) do | |
puts "~ #{dir}:" | |
system command | |
end | |
end | |
end | |
# (press Ctrl+D to break out of the loop) |
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
# usage: | |
$ cd ~/Library/Application\ Support/TextMate/Bundles | |
$ each-git | |
>> git config remote.origin.url | |
~ AsciiDoc.tmbundle: | |
git://github.com/zuckschwerdt/asciidoc.tmbundle.git | |
~ Git.tmbundle: | |
git://gitorious.org/git-tmbundle/mainline.git | |
~ GitHub.tmbundle: | |
git://github.com/drnic/github-tmbundle.git | |
~ RSpec.tmbundle: | |
git://github.com/dchelimsky/rspec-tmbundle.git | |
~ Ruby on Rails.tmbundle: | |
git://github.com/drnic/ruby-on-rails-tmbundle.git | |
~ Ruby.tmbundle: | |
git://github.com/drnic/ruby-tmbundle.git | |
>> git pull | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment