Skip to content

Instantly share code, notes, and snippets.

@mrsimo
Created January 16, 2012 09:14
Show Gist options
  • Save mrsimo/1619923 to your computer and use it in GitHub Desktop.
Save mrsimo/1619923 to your computer and use it in GitHub Desktop.
branches = `git branch`.chomp.split("\n")
branches.map!(&:strip)
branches.each do |branch|
puts "================================"
puts "Considering: #{branch}"
puts
system "git log --color --stat -n 1 #{branch}"
puts
puts
puts
puts "Want to delete it? (y/n)"
case $stdin.gets.chomp.downcase
when "y"
system "git branch -D #{branch}"
end
puts
puts
puts
end
branches = `git branch -r`.chomp.split("\n")
branches.map!(&:strip)
branches.each do |branch|
puts "================================"
puts "Considering: #{branch}"
puts
system "git log --color --stat -n 1 #{branch}"
puts
puts
puts
puts "Want to delete it? (y/n)"
remote, br = branch.split("/")
case $stdin.gets.chomp.downcase
when "y"
system "git push #{remote} :#{br}"
end
puts
puts
puts
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment