Get a List of All Git Repos Under Project Directory && Delete All Branches Except Master

Programming articles
Written by @kiosmerdeka

One way to get a list of all Git repos under your current directory (project directory) is with the following command:

find . -name '.git' | xargs -n 1 dirname

To delete all branches in your Git repository except master, simply issue the following command:

git branch | grep -v "master" | xargs git branch -D
Baca juga  How to Save an MP3 File from a YouTube Video

Leave a Comment