Skip to content

Instantly share code, notes, and snippets.

@wtnabe
Created February 29, 2012 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save wtnabe/1941119 to your computer and use it in GitHub Desktop.
Save wtnabe/1941119 to your computer and use it in GitHub Desktop.
spread each git commits to branches
#! /usr/bin/env ruby
i = 1
`git log --reverse --oneline`.lines.map { |commit|
commit.chomp.split(/\s+/).first
}.each { |ref|
system(sprintf("git branch %02d_%s %s", i, ref, ref))
i += 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment