#cli #git #vcs

How to delete all the local branches but master

In the field development the count of branches reach form 1 to 40 50 in like no time. and most of then are of no use ones merged into the master. Its better to get rid of them but deleting them is a major pain in the ass.

Here is a proposed git command i found online, i repeat i found online (i’ll give the source below).

git branch | grep -v "master" | xargs git branch -D

i guess this was helpful

source

mohammed-samgan-khan

Hi, I am Samgan, I excel at solving complex problems involving logic and step by step breakdown of the problem. Besides, to develop complex algorithms, I specialise in problem framing, systems design, and product development strategy. Sometimes I also enjoy public speaking.  

I am also the creator of penit.ink, a site which provides young writers with a free hand place to show their creation to the world. Irrespective of the niche, if you write this place is defiantly for you.