GitHub Extension in Visual Studio

github extension for visual studio

In this article, we’re gonna explore the GitHub Extension for Visual Studio 2017 by answering the below questions:

GitHub with visual studio

What’s the Git?

Git is an open-source program for tracking changes in text files. It is the core technology for the GitHub.


What’s the GitHub?

GitHub is a web-based graphical interface Git or version control repository that mostly used for code.

It provides for each project access control and several collaboration features like bug tracking, feature requests, task management, and wikis.


Repository In GitHub

A repository is the most basic element of GitHub. it’s easiest to imagine as a project’s folder.

  • A repository contains all of the project files (including documentation), and stores each file’s revision history.
  • Repositories can have multiple collaborators and can be either public or private.

GitHub Extension for Visual Studio

GitHub Extension for Visual Studio is a valuable Visual Studio Extension that brings the GitHub Flow into Visual Studio.


Install the GitHub Extension for Visual Studio

The only available default connection is Visual Studio Team Services.

Missing GitHub extension for Visual Studio

To install GitHub Extension for Visual Studio 2017, you should follow the steps below:

  • Open Visual Studio Installer 2017.
Open-Visual-Studio-2017-Installer
  • Click on the Modify button.
  • At individual Components > Below Code Tools > Check GitHub Extension for Visual Studio option. (Extension size is 5MB)
  • Wait for the installation to complete successfully.
Install-GitHub-Extension-for-Visual-Studio-2017
  • Launch Visual Studio 2017.
  • From Team Menu > Click on Manage Connections.
  • After Installing GitHub Extension, you should find the GitHub section below Manage connections section as shown below.
GitHub-extension-for-Visual-Studio-2017

Update the GitHub Extension for Visual Studio

To update the GitHub Extension from 2.2.0.10 to latest update (2.2.0.11), you should do the following:

Enable Update Extensions

  • Tools > Options > Below Environment section > Click on Extensions and Updates.
  • In case, you have opened the Visual Studio as Administrator, you will be able to enable auto-check for updates for the current user and all users extensions.
  • Check automatically check for update, and optionally enable auto-update for extensions.
Enable-Update-Extension-in-VS-2017

Check Extension & Updates in Tools Menu

  • Go to Tools menu > Extensions & Update.
  • At the Updates section, check the Visual Studio Market place, you should find a new update for GitHub Extension.
  • Click on the Update button to update the current GitHub version.
Update-Extension-in-VS-2017

Set the GitHub as the default Source Control Plug-in

To set Git as a default source control plug-in for the new solution in Visual Studio 2017, you should do the following:

  • Open Tool Menu > Options.
  • At Source Control > Plug-in Selection > Make sure that the Git is selected.
Set-GitHub-default-source-control-GitHub-Extension-in-VS-2017

Use the GitHub Extension for Visual Studio

Connect

Once you have installed GitHub Extension for Visual Studio 2017, you should connect to your GitHub account by doing the following:

  • From the Team menu, click on Manage Connections.
  • Click on Connect to connect to your GitHub account. Or signup in case, you don’t have a GitHub account by clicking on SignUp.
  • Provide your GitHub account credential > Sign In.
  • Define the repository name, and optionally set its description.
  • Select the repository path on your local computer.
  • Specify the license as you prefer > then click Create.
Connect-to-GitHub-Extension-in-VS-2017

Once you have connected to your GitHub account, you will have three options:

Create

To create a new repository, you should do the following:

  • Click on the Create button, Define the repository name, and optionally set its description.
  • Select the repository path on your local computer.
  • Specify the license as you prefer > then click Create.
Create-Git-in-GitHub-Extension-in-VS-2017

Clone

A clone is a copy of a repository that lives on your computer and connected to the remote version in GitHub.

So when you’re online you will be able to sync the changes between the two.

To Clone a Repository, you should do the following:

  • Click on Clone button to list your repositories,
  • Specify your local path as you prefer.
  • Once the repository cloned, it will be listed in Local Git Repositories.
Clone-Git-in-GitHub-Extension-in-VS-2017

Sign Out

To log off your GitHub account from Visual Studio.


Main GitHub Extension functionalities

In this section, I will explain the main functionalities of the Github Extension.

Main GitHub Extension functionalities

Changes

To track and publish the local repository changes.

Branch

A branch is a parallel version of a repository. It is contained within the repository but does not affect the primary or master branch allowing you to work freely without disrupting the “live” version. When you’ve made the changes you want to make, you can merge your branch back into the master branch to publish your changes.

Issue

Issues are suggested improvements, tasks or questions related to the repository. Issues can be created by anyone (for public repositories), and are moderated by repository collaborators. Each issue contains its own discussion forum, can be labeled and assigned to a user.

Pull Request

Pull requests are proposed changes to a repository submitted by a user and accepted or rejected by a repository’s collaborators.

Note: A collaborator is a person with reading and writes access to a repository who has been invited to contribute by the repository owner.

Pulse

Show Statistics of the merged and proposed Pull requests and the closed and new issue.

Graphs

Show Statistics of Contributors, Traffic, commits ….etc.

Wiki

Wikis provide a place in your repository to lay out the roadmap of your project, show the current status, and document software better, together.

Fetch

Fetching refers to getting the latest changes from an online repository without merging them in. Once these changes are fetched you can compare them to your local branches (the code residing on your local machine).

Pull

Pull refers to when you are fetching in changes and merging them. For instance, if someone has edited the remote file you’re both working on, you’ll want to pull in those changes to your local copy so that it’s up to date.

Commit

A commit, or “revision”, is an individual change to a file (or set of files). It’s like when you save a file, except with Git, every time you save it creates a unique ID that allows you to keep a record of what changes were made when and by who. Commits usually contain a commit message which is a brief description of what changes were made.

Sync

To share your changes with the Server.

Push

Pushing refers to sending your committed changes to a remote repository, such as a repository hosted on GitHub. For instance, if you change something locally, you’d want to then push those changes so that others may access them.


Add a new solution to GitHub from Visual Studio

To add a new solution to a local Git Repository, you should do the following:

  • Connect to the GitHub Extension.
  • At the local Git Repositories section, Select your Repository > Righ Click > Open.
  • At the Solutions Section, Click on New to add a new solution.
  • Select your solution template > Provide the solution name and path > Create.
  • Once the solution is created, it should be shown in the Solution section.
Add a new solution to GitHub from Visual Studio

Push solution to Online GitHub from Visual Studio

  • Click on Changes to list all new changes on Local Git Repository
  • Provide a new comment that describes the new changes.
  • Click on the CommitAll button.
  • Click on Sync to share your changes to the server.
  • In outgoing commit, Click on Push to push your new solution to the GitHub Online Repository.
Push solution to Online GitHub from Visual Studio

To make sure that the solution is published successfully, you should do the following:

  • Open GitHub site > Sign in with your GitHub account.
  • Click on your Repositories > Select your Branch.
  • You should now find the solution has been synced and pushed to your online repository successfully.
Publish solution to GitHub from Visual Studio

Add an existing solution to GitHub

To add an existing solution to GitHub, you should do the following: 

  • Open your solution using Visual Studio.
  • In Solution Explorer, Right clicks on the solution and select add to Source Control.
  • The solution should be added to the default source control (Git).
  • Go to your local Git Repository, Right-click and select Open.
  • You should find the solution is listed in the Solution section.
  • Click on changes to commit, sync and push your solution to GitHub Online Repository.
Push-an-exsisting--solution-to-GitHub-in-GitHub-Extension-in-VS-2017

GitHub Known Issue

In some cases, when you are trying to perform a Clone or Puch, you may get the below error

Error encountered while cloning the remote repository: Git failed with a fatal error. fatal: unable to access ‘https://github.com/Youraccount/RepName.git/’: SSL certificate problem: self-signed certificate in the certificate chai

Solution:


Make a Private Repository on GitHub

This feature is not available in GitHub extension, it’s available in the GitHub Web site, at the same time it is not available in the free plan it requires additional fees.

Update: In 08/01/2019, GitHub announced two major updates to make GitHub more accessible to developers:

  1. unlimited free private repositories, and a simpler,
  2. unified Enterprise offering.

Make a Public Repository to Private Repository

  • Open GitHub site, Sign In.
  • Open your repository, click on Settings.
  • Scroll down to the Danger Zone, you should find Make this repository private.
  • In case, you are using a free plan, you will be asked to upgrade your current free plan to the developer plan to make this repository private by paying 7$ monthly or 84$ yearly.
Private-GitHub-repository

Delete a GitHub Repository

This feature is not available in GitHub extension, it’s available in the GitHub Web site.

Note: Once you delete a repository, there is no going back. Please be certain.

To delete your repository, you should do the following:

  • Open GitHub site, Sign In.
  • Open your repository, click on Settings.
  • Scroll down to the Danger Zone, you should find Delete this repository.
  • Provide the repository name as a type of confirmation, then click on I understand button.
GitHub Extension in Visual Studio

Applies To
  • GitHub.
  • Visual Studio.
Conclusion

In conclusion, we have explored the GitHub Extension for Visual Studio 2017.

See Also
Have a Question?

If you have any related questions, please don’t hesitate to Ask it at deBUG.to Community.

4 thoughts on “GitHub Extension in Visual Studio”

Leave a Comment

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

Scroll to Top