Search code examples
gitgit-flowsourcetree

SourceTree delete all local branches under a specific directory


In SourceTree, I have many branches in the directory tree under a custom directory, it looks like this:

> File Status
> Branches
   >completed_branches
      >branch1
      >branch2
      >branch3
      ...
> Tags
> Remotes
> Stashes

Is there a git command or SourceTree button to delete all branches named /completed_branches/*?

Ideally I could just right click the folder in the directory tree and click delete, but that doesn't exist.


Solution

  • you can run the command, grabbing all branches with completed_branches, and executing the delete command on them.

     git branch | grep "completed_branches" | xargs git branch -D