Pushing to multiple remote Git Repos from Visual Studio

I’m working on an application that uses Git hosted by Visual Studio Online.  My development site is hosted as an Azure website.  I want to be able to push directly from my desktop to Azure, which is pretty simple to configure from the Azure portal by clicking on “Integrate source control”

image

Then select Local Git repository

image

You then get instruction on how to setup the remote repo from command line:

image

So although I can now push to either of my remote repo’s from Command-line (remember, my original Git Repo is in VSO), I can also do so from Visual Studio.  In Team Explorer, from the Unsynced commits section, you get the “Push to” dropdown where you can pick your remote:

image

Then click on Push and you are done!

8 thoughts on “Pushing to multiple remote Git Repos from Visual Studio

  1. Benjie Ward

    Nice article…I was wondering have you tried combining multiple urls under one remote? (so you can push to two repositories at the same time?)

    It seems like Visual Studio doesn’t play ball and only pushes to the last url listed.

    However If you run a push from the command line to the combined remote it seems to work.


Leave a Reply

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