GitHub Extension In Visual Studio 2017

In this article, I will explore the GitHub Extension for Visual Studio 2017 by answering the below questions.

  • What is the Git?
  • What is the GitHub?
  • What is the Repository?
  • What is the GitHub Extension for Visual Studio 2017?
  • How doe we install the GitHub Extension for Visual Studio 2017?
  • How do we update the GitHub Extension for Visual Studio 2017?
  • How do we set the GitHub as the default Source Control plugin for the new solution in Visual Studio 2017?
  • How do we use the GitHub Extension for Visual Studio 2017?

    • Connect.
    • Create.
    • Clone.

  • What are the main GitHub Extension functionalities?

    • Changes.
    • Branch.
    • Issue.
    • Pull Request.
    • Wiki.
    • Fetch.
    • Pull.
    • Commit.
    • Sync.
    • Push.

  • How do we add a new solution to GitHub?
  • How do we add an existing solution to GitHub?
  • Known issues?
  • How do we make a Private Repository?
  • How do we delete a GitHub Repository?
What is the Git?

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

What is the GitHub?

GitHub is a web-based graphical interface Git or version control repository that is mostly used for code. For each project, it provides access control and several collaboration features, like bug tracking, feature requests, task management, and wikis.

What is the Repository?

A repository is the most basic element of GitHub. it's the easiest to imagine as a projects 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.
What's the GitHub Extension for Visual Studio 2017?

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

How to install the GitHub Extension for Visual Studio 2017?

Before installing GitHub Extension, the only available default connection is Visual Studio Team Services.


To install GitHub Extension for Visual Studio 2017, you should follow the following steps.
  • Open Visual Studio Installer 2017.
 
  • Click on "Modify" button.
  • At individual Components > Below Code Tools, check GitHub Extension for Visual Studio option (Its size is 5MB).
  • Wait for the installation to complete successfully.
 
  • Launch Visual Studio 2017.
  • From Team Menu, click on "Manage Connections".
  • After installing GitHub Extension, you should find GitHub section as shown below.
How to update the GitHub Extension for Visual Studio 2017?

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 for update,s and optionally enable auto update for extensions.

 Check Extension & Updates in Tools Menu
  • Go to Tools menu > Extensions & Update > at 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.
How to 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 Menue > Options.
  • At Source Control > Plug-in Selection > Make sure that the Git is selected.
How to use the GitHub Extension for Visual Studio 2017?

Connect

Once you have installed GitHub Extension for Visual Studio 2017, you should connect to your GitHub account by doing the following:
  • From 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 repository path on your local computer.
  • Specify the license as you prefer > then click Create.
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 Create button, Define the repository name, and optionally set its description.
  • Select repository path on your local computer.
  • Specify the license as you prefer > then click Create.

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.
 
Sign Out

To log off your GitHub account from Visual Studio.

What're the main GitHub Extension functionalities?

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

 

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.

How do we add a new solution to GitHub?

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 Solution section.
 
 To push the solution to Online GitHub, you should do the following,
  • Click on Changes to list all new changes on Local Git Repository
  • Provide a new comment that describes the new changes.
  • Click on 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.

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. 

How do we 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, Righ 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.
Known Issue

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

Solution

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

The new update of Visual Studio should solve this issue, as a temporary solution change the path of your Local Repository that will solve the issue.If you still face the issue check,

How to make a Private Repository?

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.

To make a Public Repository to Private 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 Make this repository private.
  • In case, you are using a free plan, you will be asked to upgrade your current free plan to developer plan to make this repository private by paying 7$ monthly or 84$ yearly.
 

How to 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.
 
Conclusion

In this article, we have explored the information regarding GitHub Extension for Visual Studio 2017.

See Also

Up Next
    Ebook Download
    View all
    Learn
    View all