Removing Git branches by mask

No comments on Removing Git branches by mask

Written by

in

When working in a team with Git, you often have to create and delete branches. If you are a terminal user like me, you can optimize branch deletion as follows. Maybe someone will come in handy, I use it all the time.

Before:

% git branch
  MOBL-2509/0
  MOBL-2509/1
  MOBL-2522/0
  MOBL-2522/1
  MOBL-2522/2
* master
  release/5.4

Apply:

% git branch | grep "MOBL" | xargs git branch -d

After:

% git branch
* master
  release/5.4

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *