Adding GitHub upstream remote in Visual Studio

Forking and opening a GitHub repo in Visual Studio is a matter of seconds. But how to keep your fork up-to-date easily, all within the Team Explorer window? All you need to do is to add the upstream remote.

Navigate to your cloned fork in Team Explorer, click the title bar to reveal repository menu and select Settings.

Settings
Settings

In the opened page select Repository Settings and then find the Remotes section at the bottom:

Remotes
Remotes

Click the Add link to open the Add Remote dialog window. Here fill out:

  • Name – upstream
  • Fetch – URL of the original GitHub repository you forked
  • Push – same as Fetch
  • Push matches fetch – leave checked
Adding upstream remote
Adding upstream remote

Confirm with Save and that’s almost it. Now we just need to do a fetch to get the current state of the upstream. Click the title of the Team Explorer window again and navigate to Sync:

Sync
Sync

And from the top menu click the Fetch link, select upstream from the dropdown menu and click Fetch. Now the branches from the repository should be available in the Branches view and you can merge the latest changes from upstream in your fork.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.