Over a million developers have joined DZone.

Publishing Existing Applications to GitHub With Visual Studio 2015

DZone 's Guide to

Publishing Existing Applications to GitHub With Visual Studio 2015

A brief tutorial explaining how to integrate your GitHub account with Visual Studio for easy version control.

· DevOps Zone ·
Free Resource

A while ago, I published a blog post for using GitHub with Visual Studio team explorer. In reference to this blog post, one of the users emailed me asking, "how we can publish existing applications to Github?" So I thought it would be a great idea to write a blog post about it. So in this blog post, We are going to learn how we can publish existing applications to GitHub with Visual Studio 2015. Visual Studio 2015 comes with Team Explorer, and when you install Visual Studio 2015, there is an option to install the GitHub extension. If you have not installed it then you can also insert separately from the following link: https://visualstudio.github.com/

How to Publish Existing Applications to GitHub With Visual Studio 2015:

To demonstrate this we are going to use the console application. I have created a core console application with File-> New project.


Once I've created the application, I have added it to the source via right clicking "solution explorer" and clicking on "Add Solution to Source Control."


It will add the solution to default source control, In my Visual Studio, Git is configured as the default source control. But if it is not set, it will ask you to choose between Git or Team Foundation Server. Once you click on "Add Solution to Source Control", it will create a local Git repository. Now it’s time to write some code. Here is some sample code that I have written.

using System;
namespace GithubConsoleApp
    public class Program
        public static void Main(string[] args)
            Console.Write("Github sample application");

Now it's time to commit code to a Local Git repository with Team Explorer:


Once you click "sync" it will try to sync with the remote Git repository since we don’t have a remote repository:


Here, there are three options available, Github, Team Services, or a custom remote repository. Since we are going to use GitHub, click on GetStarted for GitHub option. It will load the following screen:


My GitHub account is already configured, otherwise it will ask for your GitHub Credentials.  Now click on "publish", and it will create a new repository in GitHub and publish the whole history to as well.


You can see the same thing on github.com:


That’s it. It’s very easy to use GitHub tools with Visual Studio 2015. Hope you like it. Stay tuned for more!

You can find sample Github repository used in this application at https://github.com/dotnetjalps/GithubConsoleApp

Github ,visual studio ,.net ,asp.net

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}