Skip to content

Instantly share code, notes, and snippets.

@allex
Created July 16, 2014 03:06
Show Gist options
  • Save allex/79d772509ab366776d1d to your computer and use it in GitHub Desktop.
Save allex/79d772509ab366776d1d to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'io/console'
# GistID: 79d772509ab366776d1d
if __FILE__ == $0
branch_name = ARGV[0] if (ARGV[0])
print "Press Y to force delete local and remote branch #{branch_name}..."
response = STDIN.getch
if ['Y', 'y', 'yes'].include?(response)
puts "\nContinuing."
`git branch -D #{branch_name}`
`git branch -D -r origin/#{branch_name}`
`git push origin --delete #{branch_name}`
else
puts "\nQuitting."
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment