Skip to content

Instantly share code, notes, and snippets.

@davidrupp
Created November 4, 2009 02:31
Show Gist options
  • Save davidrupp/225717 to your computer and use it in GitHub Desktop.
Save davidrupp/225717 to your computer and use it in GitHub Desktop.
find all git repos and 'git pull' each of them
#!/usr/bin/env ruby
require 'find'
Find.find("/Users/david/Developer") do |path|
Dir.chdir(path) do |d|
next unless File.exists? ("#{d}/.git")
puts d
`git pull`
Find.prune
end if File.directory?(path)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment