VS Code / GitHub

Installing GitHub in Visual Studio Code for Windows 10

A step-by-step installation guide to integrating GitHub with VS Code.

Bipin P.
Towards Data Science
5 min readMar 17, 2020

--

Photo by ©iambipin

Visual Studio Code has become the preferred code editor for most developers around the globe. Its popularity is surging every passing minute. Thanks to its attractive array of features like Intellisense that have made it indispensable for developers.

Like VS Code, GitHub is also imperative for the developer community. Hence it is very important to know how to install GitHub in the Visual Studio Code. For the uninitiated, GitHub is a web-based hosting service based on the Git Version Control System.

Before installation, it is essential to check whether Git is installed on Windows. To verify, open the command prompt of windows by pressing the Windows key and R.

Inside command prompt, type git — version to know the version of Git installed. If Git is not installed, the command prompt will return a message as shown in the image below.

Now open the VS Code and go to Source Control of its activity bar. In a system where Git is absent, ‘No source control providers registered’ message will be displayed.

Git Installation for Windows

Let’s download git from https://git-scm.com/downloads.

Run the .exe file downloaded from the Git website. Follow the image sequence given below for installing Git in Windows 10.

Now that the Git is installed, let’s verify the same by opening Git Bash.

To clone a repo from GitHub using the VS Code

Step 1: Select a repository in GitHub and click on the green button at the top right corner that reads clone or download. Copy the link that appears on the drop-down bar.

Step 2: Open VS Code, Go to File -> Add Folder to Workspace…

Add the newly created folder.

VS Code interface will resemble the image below:

Step 3: Open the terminal.

Step 4: To link your GitHub account, type git config -- global user.name <GitHub user ID>

Step 5: type git clone <url copied from GitHub during Step 1> to clone a repo from GitHub using VS Code.

On completion of the installation, the VS Code user interface will be as shown in the image below.

Go to Source Control of activity bar to verify whether Git has been installed correctly. If installed correctly, the UI will resemble the image below (SOURCE CONTROL: GIT can be seen on the top left of the underlying image).

Additional Notes

To open the VS Code from the Current Working Directory(CWD), there are two methods as mentioned below:

Method 1: Open command prompt(Windows key + R > Type cmd). Then change to the desired directory by cd <path to the directory>

Then type code . in the command prompt to open the VS Code.

You can verify the same by opening the terminal and checking the Windows Powershell.

Method 2: File > Open Folder…

Select the desired folder.

Then the Current Working Directory will be the selected folder.

I hope you guys will find the information helpful. Happy Coding!!!

--

--