Skip to content

Instantly share code, notes, and snippets.

@jkubicek
Created March 1, 2013 19:06
Show Gist options
  • Save jkubicek/5066945 to your computer and use it in GitHub Desktop.
Save jkubicek/5066945 to your computer and use it in GitHub Desktop.
Merges the current branch into master and deletes the branch. Doesn't attempt to fix any issues and will fail if something goes wrong.
#! /usr/bin/ruby
unless `git status -s`.strip.empty?
puts "Cannot merge-it when your working directory is dirty.\nClean that shit up, bruh"
exit
end
curr_branch = `git branch | grep "*" | sed "s/* //"`.strip
system("git checkout master && git merge #{curr_branch} && git branch -d #{curr_branch}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment