-
-
Save sharnik/1620161 to your computer and use it in GitHub Desktop.
This file contains 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
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 |
This file contains 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
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 | |
system "git prune" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment