Refresh git remote branches in Visual Studio

Visual Studio doesn’t always refresh the git remote/published branches in the Branches View.

My solution to force a sync in Visual Studio is calling the git remote “prune” command (https://git-scm.com/docs/git-remote). This command will immediately detect new remote branches or remove the “stale” branches. Instant update in Visual Studio.

SNAGHTML1465e1b2

Advertisements

One Response to Refresh git remote branches in Visual Studio

  1. You can configure git to do this automatically on fetch/pull running with this command:

    git config remote.origin.prune true –global

    VS should do this by default. They ‘make’ you delete branches when completing a PR in Team Services, but in VS the branch will keep being listed until prune 😐

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: