Skip to content

Instantly share code, notes, and snippets.

@fujimura
Created August 11, 2014 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fujimura/9bbff53bab2854f59aff to your computer and use it in GitHub Desktop.
Save fujimura/9bbff53bab2854f59aff to your computer and use it in GitHub Desktop.
Import all git repo from old repositories directory to ghq
Dir['./*']
.select {|d|File.directory? (d + "/.git") }
.map {|d| `cd #{d} ; git config remote.origin.url ; cd ../ `.chomp }
.reject {|u| u.empty? }
.each {|u| `ghq get #{u}` }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment