Skip to content

Instantly share code, notes, and snippets.

@patmaddox
Created March 1, 2009 06:38
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 patmaddox/72246 to your computer and use it in GitHub Desktop.
Save patmaddox/72246 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
if File.exist?("blackjack")
puts "whoops looks like you already have a folder named blackjack"
exit
end
`git clone git://github.com/pat-maddox/blackjack.git`
Dir.chdir("blackjack") do
remote_branches = `git branch -r`.split("\n").map{|s| s.strip}.reject {|b| b.include? 'master'}
remote_branches.each do |remote_branch|
local_branch = remote_branch.gsub("origin/", "")
`git branch #{local_branch} #{remote_branch}`
end
puts "done :)"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment