How do I connect to my existing Git repository using Visual Studio Code?
- Open Visual Studio Code terminal (Ctrl + `)
-
Write the Git clone command. For example,
git clone https://github.com/angular/angular-phonecat.git
-
Open the folder you have just cloned (menu File → Open Folder)
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.
- Use
git clone
to clone your repository into a folder (say work). You should see a new subfolder,work/.git
. - Open folder work in Visual Studio Code - everything should work fine!
PS: Blow away the temporary folder.
Use the Git GUI in the Git plugin.
Clone your online repository with the URL which you have.
After cloning, make changes to the files. When you make changes, you can see the number changes. Commit those changes.
Fetch from the remote (to check if anything is updated while you are working).
If the fetch operation gives you an update about the changes in the remote repository, make a pull operation which will update your copy in Visual Studio Code. Otherwise, do not make a pull operation if there aren't any changes in the remote repository.
Push your changes to the upstream remote repository by making a push operation.