Created
May 16, 2018 03:28
-
-
Save takeshy/bafdafb359b4aec02eb5931eeaeb87ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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