During a development, a lot of branches are created on Git for all features or evolutions.

After a certain time, we can have on local machine many branches but some cleaning may be necessary.

For instance, If you want to delete all local branches that are already merged into master, you can use the following command:

git branch --merged master | grep -v '^[ *]*master$' | xargs git branch -d

Add a comment

Next Post Previous Post