# Visual Studio: automatically remove stale remote/origin branches

> When using Git in Visual Studio very soon we see that the branches remotes/origin do not automatically sync with the server. Some branches will exist locally when…

- Author: Jérôme Giacomini
- Language: en
- Canonical URL: [Visual Studio: automatically remove stale remote/origin branches](https://jeromegiacomini.net/articles/2019/09/02/visual-studio-automatically-remove-stale-remote-origin-branches)
- Published: 2019-09-02
- Last modified: 2026-09-05
- Topics: .NET, Visual Studio

When using Git in **Visual Studio** very soon we see that the branches **remotes/origin** do not automatically sync with the server.
Some branches will exist locally when they no longer exist on the server side, which can cause quiproquos.
To synchronize these branches with each **fetch** It's very simple.
Just open the Team Explorer window and click Settings **,** Then set to True PrPrune remote branches during fetch”.

Option Prune remote branches during fetch activated:

![](https://jeromegiacomini.net/Blog/wp-content/uploads/2019/08/prune.png)

Happy coding 🙂
