Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I connect to my existing Git repository using Visual Studio Code?

I've been using Visual Studio code for a long time, since v0.9.1. I now have run into the need to use GitHub and an online Git repository.

I have the online Git repository set up and have been pushing changing to the online repository using GitHub. I have recently come to realize I can save myself a step with using Visual Studio Code to do both: to edit my code, then send it up to the online repository.

I am very new to the whole Git concept. Visual Studio Code had me install the "Git" plugin which installed Git Bash, Git CMD, and Git GUI.

This is the online repository URL I'm trying to get to: https://github.com/SpectrumGraphics/Spectrum-Graphic-Designs.git

Visual Studio Code GitPlugin Visual Studio had my install

like image 282
Charles L. Avatar asked Oct 21 '15 15:10

Charles L.


People also ask

How do I join an existing Git repository in VS Code?

Opening a repository Once you have installed the GitHub Repositories extension, you can open a repository with the GitHub Repositories: Open Repository... command from the Command Palette (Ctrl+Shift+P) or by clicking the Remote indicator in the lower left of the Status bar.


2 Answers

Another option is to use the built-in Command Palette, which will walk you right through cloning a Git repository to a new directory.

From Using Version Control in VS Code:

You can clone a Git repository with the Git: Clone command in the Command Palette (Windows/Linux: Ctrl + Shift + P, Mac: Command + Shift + P). You will be asked for the URL of the remote repository and the parent directory under which to put the local repository.

At the bottom of Visual Studio Code you'll get status updates to the cloning. Once that's complete an information message will display near the top, allowing you to open the folder that was created.

Note that Visual Studio Code uses your machine's Git installation, and requires 2.0.0 or higher.

like image 23
James Skemp Avatar answered Oct 09 '22 23:10

James Skemp


  1. Open Visual Studio Code terminal (Ctrl + `)
  2. Write the Git clone command. For example,

    git clone https://github.com/angular/angular-phonecat.git 
  3. Open the folder you have just cloned (menu FileOpen Folder)

    Enter image description here

like image 156
Shahdat Avatar answered Oct 09 '22 23:10

Shahdat