Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force Visual Studio to refresh list of remote git branches in Team Explorer-Branches?

Visual Studio 2015 and 2017 doesn't update remote branches in Team Explroer - Branches section. This means that whenever somebody adds a branch on remote or remove I can't see it through Team Explorer. Instead I am forced to use Source Tree and then magically Visual Studio notices the new branches. I click refresh button like a maniac and I tried following commands in Package Manager Console:

git remote prune origin --dry-run
git config remote.origin.prune true

it does nothing or at least not what I am asking.

How to fix this?

like image 879
Yoda Avatar asked Nov 30 '17 11:11

Yoda


2 Answers

You need to trigger a git fetch from Visual Studio (which Sourcetree has been doing up until now)

In Visual Studio 2017 Team Explorer go to the "Branches" section, right click the Master branch and select "fetch". You should now be able to see the new remote branches.

like image 158
Edmund Dipple Avatar answered Sep 26 '22 19:09

Edmund Dipple


Proper way to refresh remote branches is

git fetch -p

because

git fetch 

does not remove non existing branches.

like image 41
Piotr Avatar answered Sep 23 '22 19:09

Piotr