DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Publishing Existing Applications to GitHub With Visual Studio 2015

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.

Jalpesh Vadgama user avatar by
Jalpesh Vadgama
·
Aug. 22, 16 · Tutorial
Like (1)
Save
Tweet
Share
2.96K Views

Join the DZone community and get the full member experience.

Join For Free

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.

Sample-Conole-Application

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."

add-to-source-control-github-sample-application

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");
            Console.ReadLine();
        }
    }
}


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

commit-changes-in-git

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

different-service-for-hosting-github-service

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:

github-publishing-sample-application

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.

published-app-sample-application

You can see the same thing on github.com:

published-application-on-github

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 application

Published at DZone with permission of Jalpesh Vadgama, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Java Development Trends 2023
  • Memory Debugging: A Deep Level of Insight
  • Secrets Management
  • Continuous Development: Building the Thing Right, to Build the Right Thing

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: