Created
July 16, 2014 03:06
-
-
Save allex/79d772509ab366776d1d 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 | |
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