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.
![]() |
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).
I hope you guys find the information helpful. Watch this space for more updates on VS Code tips and tricks. Happy Coding!!!
Comments
Post a Comment