Visual Studio 2017: Install and Use GitHub Extension
Introduction
In this article. we will explore the GitHub Extension for Visual Studio 2017 by answering the below questions:
- What's the Git?
- What's the GitHub?
- What's the Repository?
- What's the GitHub Extension for Visual Studio 2017?
- How to install the GitHub Extension for Visual Studio 2017?
- How to update the GitHub Extension for Visual Studio 2017?
- How to set the GitHub as the default Source Control plugin for the new solution in Visual Studio 2017?
- How to use the GitHub Extension for Visual Studio 2017?
- Connect.
- Create.
- Clone.
- What're the main GitHub Extension functionalities?
- Changes.
- Branch.
- Issue.
- Pull Request.
- Wiki.
- Fetch.
- Pull.
- Commit.
- Sync.
- Push.
- How to add a new solution to GitHub?
- How to add an existing solution to GitHub?
- Known Issue.
- How to make a Private Repository?
- How to delete a GitHub Repository?
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.
What's the Repository?
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.
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 mentioned below steps:
- Open Visual Studio Installer 2017.
- Click 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 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 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.
- Check Extension & Updates in Tools Menu.
- Go to Tools menu > Extensions & Update > at Updates section, check the Visual Studio Marketplace, you should find a new update for GitHub Extension.
- Click 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 Manage Connections.
- Click Connect to connect to your GitHub account. Or signup in case, you don't have a GitHub account by clicking 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 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 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 to 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 > right-click > Open.
- At the Solutions Section, click 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 Changes to list all new changes on Local Git Repository
- Provide a new comment that describes the new changes.
- Click CommitAll button.
- Click Sync to share your changes to the server.
- In outgoing commit, Click 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 your Repositories > Select your Branch.
- You should now find the solution has been synced and pushed to your online repository successfully.
How to 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-click 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 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 Push 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:
- 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.
Update: In 08/01/2019, GitHub announced two major updates to make GitHub more accessible to developers: unlimited free private repositories, and a simpler, unified Enterprise offering.
To make a Public Repository to Private Repository, you should do the following:
- Open GitHub site, Sign In.
- Open your repository, click 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 Settings.
- Scroll down to the Danger Zone, you should find Delete this repository.
- Provide the repository name as a type of confirmation, then click I understand.
Conclusion
In this article, we have explored the GitHub Extension for Visual Studio 2017.
Return to Top