I work on a number of projects on GitHub now, with Chef (client) being one of the largest and most active.
Every time I fetch from GitHub, I get all the current branches. Branches tend to be short lived in this project, existing solely for a feature or a bugfix (which allows us to use Pull Requests for code reviews and discussion). However, when a branch gets removed from GitHub's version of the repository, that change doesn't sync down to me when I fetch changes. This is a good thing - as it keeps me in control of my local repository.
However, from time to time, I want to clean up those remote branches that do not exist anymore.
git remote prune origin
To show what would be pruned: <pre>git remote prune origin--dry-run
There are more options with git gc (and that is recommended), but git prune did what I was looking for.Want more great reading? Check out my reading list!