Understanding GitHub and Visual Studio

by Hannes DuPreez
Understanding GitHub and Visual Studio

Explore and master using the GitHub Extension for Visual Studio.

Visual Studio is not only the best development IDE, but it also is the most convenient IDE. Microsoft keeps making things easier for developers who use Visual Studio. A perfect example of this fact is the addition of the GitHub Extension for Visual Studio, which is the best way to use Git in Visual Studio. Today, I will introduce you to the GitHub Extension for Visual Studio.

What Is GitHub?

GitHub is a Web-based version control, or Git repository and Internet hosting service. GitHub provides access control and several collaboration features such as bug tracking, feature requests, task management, and wikis for every project.

What Is Git?

Git is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.

If you are new to GitHub, or are not sure how GitHub works, this great tutorial will help get you started.

GitHub in Visual Studio

To make use of GitHub from inside Visual Studio, you need the GitHub Extension for Visual Studio. To get this extension, follow these easy steps:

  1. Open Visual Studio.
  2. Click Tools.
  3. Click Extensions and Updates.
  4. Click Online.
  5. Search for GitHub.
  6. Select GitHub Extension for Visual Studio.
  7. Click Download.

Extensions and Updates
Figure 1: Extensions and Updates

It will prompt you to install, as shown next

VSIX Installer
Figure 2: VSIX Installer

Restart Visual Studio for the Extension to finish installing. Your Team Explorer tab will now show that you have access to GitHub, as shown in Figure 3.

Team Explorer
Figure 3: Team Explorer

As you can see, there are two sections dedicated to Gits and GitHub. GitHub is the Hub that is the hosting service for all the Gits, whereas Local Git Repositories shows all the Gits on your local machine.

To create a new Local Git Repository, follow these steps:

  1. Open the Team Explorer tab.
  2. Under Local Git Repositories, click 'New.'
  3. Give it a decent name, as shown in Figure 4.

    New Local Git Repository
    Figure 4: New Local Git Repository

  4. Click Create.

If you double-click the repository that has been created, Team Explorer will look like Figure 5.

Local Repository Team Explorer
Figure 5: Local Repository Team Explorer

Now, you can either create a new Solution or open a current Solution.

New Solution
Figure 6: New Solution

After you have done some changes to your project and are satisfied with your progress for the day, you can Commit the changes as shown next:

Commit Changes
Figure 7: Commit Changes

Or, you can Merge your Branches.

Merge Branches
Figure 8: Merge Branches

Or, Sync your changes to GitHub.

Sync Changes
Figure 9: Sync Changes

Publish to GitHub
Figure 10: Publish to GitHub

Figure 11: Published

You can go to GitHub with your browser and navigate to the given URL to see the project in action.

Figure 12: GitHub.com

This project doesn't do anything at all, but now other developers can contribute to this project's nothingness, or one day I can resurrect this project and do something decent with it. You can make changes inside the Web interface and obviously pull these changes into your Visual Studio solution.


GitHub is growing on a daily basis, and with Microsoft making it even easier to access your projects, or other projects through Visual Studio, it will keep on growing. I hope you have enjoyed this article. Until next time, goodbye!

This article was originally published on Monday Mar 6th 2017
Mobile Site | Full Site