Last Updated: September 30, 2021
·
493
· dawsonbotsford

Remove git branch locally and on remote

You've just merged a branch on git. You should delete that branch now:

# Usage: "$ burn <feature branch>"
burn() {
  git branch -D "$1" # Delete branch locally
  git push origin :"$1" # Delete branch from remote (GitHub)
}

Just throw this in your ~/.bashrc, ~/.zshrc, etc. and start burning your branches today!

If that feature branch was named dopeNewFeature, you'd simple enter $ burn dopeNewFeature when in master.

2 Responses
Add your response

(y)

over 1 year ago ·

I set this up a long time ago and named it nuke

over 1 year ago ·