Back to Home


gclean

Bash script that git pulls a repository and cleans up local branches that no longer exist remotely.

At work, I found myself wanting to clean up the local branches for my repositories so that I wouldn't have a messy list of old branches when I ran git branch -a. It would end up with me repeatedly running a bunch of git commands all the time. So I thought, shouldn't there be a better way where I can do all these same steps in one command. This resulted in the creation of a bash script with a symbolic link to PATH so that I can now clean up my repositories with one commmand.

Click on the link below to view the code on GitHub.

gclean - GitHub Repo

Back to Home