5

I am having this problem where in VS2013 when I create a new branch from origin, the dropdown with the source branches lists ALL branches ever created. This includes branches that have long been deleted from both the local repo and the remote/origin repo.

http://imgur.com/uxPZjVL

How do I remove the deleted branches?

magicandre1981
  • 27,895
  • 5
  • 86
  • 127
Ravenheart
  • 147
  • 6
  • Possible duplicate of [How to prune local tracking branches that do not exist on remote anymore](http://stackoverflow.com/questions/13064613/how-to-prune-local-tracking-branches-that-do-not-exist-on-remote-anymore) – 1615903 Jul 11 '16 at 10:20
  • 1
    It is not a duplicate, I have successfully deleted the local branches, the problem is the dropdown box with the REMOTE/ORIGIN branches that does not get refreshed correctly. The same thing in VS2015 works fine. – Ravenheart Jul 11 '16 at 13:30

1 Answers1

3

Visual Studio keeps these in a local cache.

You can run the following from a command prompt, then whenever you do a fetch from the Sync menu in Team Explorer, the branches will be pruned:

git config remote.origin.prune true

Seems like this should be set by default!

If you want to apply this system wide, you can use this:

git config --global remote.origin.prune true
Karl Gjertsen
  • 4,690
  • 8
  • 41
  • 64