Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I refresh the list of remote branches in my Visual Studio 2017 Team Explorer panel?

How can I refresh the list of remote branches in my Visual Studio Team Explorer panel?

In the Visual Studio 2017 Team Explorer, Branches panel, I could see the 10 or so branches in our VSTS instance.

Then in Chrome, I deleted some of the older branches and created a new branch.

Switched back to VS 2017, but the list of remotes/origin branches still shows the old list, and I can't find anyway to refresh it.

I tried changing to a different repo, the F5 Refresh on the Team Explorer header, I even closed and reopened VS 2017... but nothing refreshes the list to match what VSTS portal shows.

like image 955
SteveC Avatar asked Jul 19 '17 12:07

SteveC


People also ask

How do I find the remote branch in Visual Studio?

Find the remote branch in remotes -> origin , then double-click that branch to get it selected locally.

How do I sync a branch in Visual Studio?

For more information on Sync, see Use git fetch, pull, push and sync for version control in Visual Studio. Open the Team Explorer and open the Sync view. Then select the Pull link under Incoming Commits to pull remote changes and merge them into your local branch.

What is prune remote branches during fetch?

git fetch --prune is the best utility for cleaning outdated branches. It will connect to a shared remote repository remote and fetch all remote branch refs. It will then delete remote refs that are no longer in use on the remote repository.


2 Answers

If you want Visual Studio 2017 to ALWAYS prune on fetch (I do, I add and remove a LOT of branches for UI work), once you install 3rd party Git (can do from Settings within Team Explorer, Git section) there will be a new option in Global Settings (also in Git section) to 'Prune remote branches during fetch' which you can set to True. I did not have this option before updating my VS to 15.5 (I was on 15.0).

Location of prune setting

like image 140
TerraElise Avatar answered Sep 28 '22 19:09

TerraElise


You can Fetch in Visual Studio Team Explorer.

View => Team Explorer

enter image description here

like image 24
Erik Hakobyan Avatar answered Sep 28 '22 18:09

Erik Hakobyan