Create a gist now

Instantly share code, notes, and snippets.

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