There's more...

There are several ways to remove the branches from Git that have been deleted from the master. It can be done while updating the local repository, as we saw with git fetch --prune, and also with git pull --prune. It can even be performed with the git remote prune origin command. This will also remove the branches from Git that are no longer available on the remote, but it will not update remote-tracking branches in the repository.

Get Git Version Control Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.