Share Your Code In GitHub Using Visual Studio 2013

What is Git

  • Git is a free and open source distributed version control system that handles the projects similar to other version control systems - Mercurial, Subversion, CVS, etc.

  • Git is the best place to share code with team members, classmates or anyone who is on the web.

What is Repository

  • A repository is a place where all the files for a particular project are stored.

Step 1: For sharing code on GitHub you must have an account on GitHub and if you do not have account, go to GitHub web site and create an account. Here is the link.

Step 2: Create a project that you want to share on GitHub

Now add the Source control to project in visual studio. Go to Tools, click on Options and go to Source

Control from right side dropdown and select Microsoft Git Provider. After that click OK

Step 3: Right click on project solutions, click on Add Solution to Source Control, then select Git radio button and click OK.

Now my project is connected to git source control. 

Step 4: Now login into your GitHub account , after login just see the left side of your profile photo and click on + symbol. Then click on create new repository,  give any name here. I have given FirstMvc.

Now you have created a repository, copy the url.

Step 5: Now right click on project solution and click on Commit

Enter a commit message you can write anything. Here I am giving message myfirstcommit and click on Commit.

After commit you will get a message like the following. Then click on Sync to share your changes with the server.

Then enter your github repository url and then click Publish.


Now my code is publish on my git hub account. Let's go to GitHub account and we can see the following:

Point of Interest

Here we learned how to share code on GitHub using Visual Studio 2013.

Recommended Ebook

Printing in C# Made Easy

Download Now!
Similar Articles