git cleanup


Have you ever ran git branch and realized you have hundreds of old branches on your local machine? This is a super easy way to clean those up.

If you run git config -e --global then paste this in there:

    cleanup = "!git branch --merged | grep  -v '\\*\\|master\\|develop' | xargs -n 1 git branch -d"

Then you will be able to run git cleanup and it will delete all local branches that have already been merged! Beautiful!

Credit goes to real_ate on this stackoverflow post

Recent Posts

  1. Website Checklist
  2. How Matt Makes a Steak
  3. Simple IK Foot in Blender

Find a Post