How to prune remote branches in Git
Monday, January 26, 2026
Remote branch pruning removes stale references to deleted remote branches, keeping local repository clean and preventing confusion from outdated branch listings. As the creator of CoreUI, a widely used open-source UI library, I’ve maintained clean Git repositories across distributed teams throughout my 25 years of development experience. The most effective approach is using git fetch –prune to automatically remove remote-tracking branches that no longer exist on remote. This method provides automatic cleanup during fetch operations, prevents accumulation of stale references, and maintains accurate branch listings without manual intervention.