Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env ruby
branches = `git branch`
branches.each_line do|line|
branch = line.gsub(/\s/,"")
next if branch[0] == "*"
puts "################"
puts "#{branch}\n"
puts "################"
puts `git branch -d #{branch}`
next if $?.exitstatus == 0
meta = `git log #{branch}|head -n 6`
puts "#{meta}\n\n削除していいですか?(y/n)"
result = STDIN.gets
if result.chomp == "y"
puts `git branch -D #{branch}`
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.