Skip to content

Instantly share code, notes, and snippets.

@crawsible
Created March 16, 2016 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crawsible/5923afa0334eb8dd0ccb to your computer and use it in GitHub Desktop.
Save crawsible/5923afa0334eb8dd0ccb to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
File.readlines(ARGV[0]).each do |line|
branch = line.split(/\s/).first
puts "current branch:"
puts branch
puts `git log #{branch} --pretty=fuller -1`
puts "delete? Y/n"
res = $stdin.gets.chomp.downcase
next unless ['y', ''].include?(res)
puts "DELETE DAT BRANCH: #{branch}"
puts `git branch -D #{branch}`
puts `git push origin :#{branch}`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment