You need to make sure VSCode is opened with the same user account as the one used in your initial git bash.

In each session (bash and VSCode), execute a:

mkdir test
cd test
# Git bash
git -c core.sshCommand='ssh -Tv' clone git@github.com:...
# or, in POwershell
git -c core.sshCommand="ssh -Tv" clone git@github.com:...

See if the SSH key is looked into C:\Users\<You>\.ssh\id_rsa

Check also if you have created your private key encrypted with a passphrase.

If so, in VSCode, you would need to enable the SSH agent service.

Answer from VonC on Stack Overflow
🌐
Visual Studio Code
code.visualstudio.com › docs › sourcecontrol › repos-remotes
Working with repositories and remotes
November 3, 2021 - By default, Git configures a remote ... a repository, run the Git: Clone command in the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)), or select the Clone Repository button in the Source Control view....
🌐
Visual Studio Code
code.visualstudio.com › docs › sourcecontrol › github
Work with GitHub in VS Code
1 month ago - You can search for and clone a repository from GitHub using the Git: Clone command in the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)) or by using the Clone Repository button in the Source Control view (available when you have no ...
Discussions

How to "git clone " in Visual studio code - Stack Overflow
Today, I am following this video ... I using Windows. I've set it all successfully by also following the official instruction (https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh) and it works on Git Bash: But I failed when I tried to "git clone" in Visual Studio Code, like ... More on stackoverflow.com
🌐 stackoverflow.com
git - Clone GitHub repository in VSCode - Stack Overflow
I'm trying to clone a GitHub repository into the newest release of VSCode (1.3.0). Can this be done natively or do I need to add an extension or additional binary? I've also searched for a blog ar... More on stackoverflow.com
🌐 stackoverflow.com
Where is VS Code cloning a git repository? - Stack Overflow
I ran the git:clone command in VS Code command palette to clone a repository from GitHub. Where is the repo getting cloned to? VS Code is running locally on my laptop. I am on a Windows machine. Wh... More on stackoverflow.com
🌐 stackoverflow.com
[deleted by user]
Command line: git clone https://... More on reddit.com
🌐 r/vscode
6
0
September 4, 2024
🌐
Microsoft Learn
learn.microsoft.com › en-us › azure › developer › javascript › how-to › with-visual-studio-code › clone-github-repository
GitHub Repositories in Visual Studio Code for JavaScript - JavaScript on Azure | Microsoft Learn
Open the command palette with the key combination of Ctrl + Shift + P. At the command palette prompt, enter gitcl, select the Git: Clone command, then select Clone from GitHub and press Enter.
🌐
ComputingForGeeks
computingforgeeks.com › home › cloning git repository from github in visual studio code
Cloning git repository from GitHub in Visual Studio Code
March 16, 2026 - Once VS Code is launched, you may access the command palette by pressing Ctlr+Shift+P. Then type gitcl there, Git: Clone will appear in the search results; choose it. Next, you will be prompted to provide the repository URL.
🌐
Reddit
reddit.com › r/vscode › [deleted by user]
[deleted by user] : r/vscode
September 4, 2024 - It's not supposed to be there: https://learn.microsoft.com/en-us/azure/developer/javascript/how-to/with-visual-studio-code/clone-github-repository
🌐
GeeksforGeeks
geeksforgeeks.org › git › how-to-clone-a-project-from-github-using-vscode
How to Clone a Project From GitHub using VSCode? - GeeksforGeeks
May 16, 2024 - Visual Git Interface: VSCode offers a visual interface for Git operations, making it easier to manage repositories, branches, and commits. Seamless GitHub Integration: With VSCode's GitHub integration, developers can browse, clone, and manage GitHub repositories without leaving the editor.
🌐
H2S Media
how2shout.com › home › developer › how to clone git repository from github in visual studio code?
How to Clone Git repository from GitHub in Visual Studio Code? - H2S Media
October 2, 2023 - If you haven’t already installed ... i.e. – winget install Microsoft.VisualStudioCode · Once you have opened the VSCode, press Ctlr+Shift+P to open the command palette....
Find elsewhere
🌐
Medium
medium.com › @sarahlkhan › how-to-clone-git-repository-in-microsoft-vs-code-c113bcd499ab
How to Clone Git Repository in Microsoft VS Code | by Sarah Khan | Medium
June 10, 2024 - Open the project on GitHub · Select the green button labeled Code · Next to the url that shows up select the symbol Copy url to clipboard · Open Microsoft Visual Studio Code · Find and select Clone git repository under Start ·
🌐
JC Chouinard
jcchouinard.com › accueil › how to clone a github repository with vs code (example)
How to Clone a Github Repository with VS Code (Example) - JC Chouinard
November 17, 2023 - To clone your repository, you need to copy the web URL linked to your repository on Github and clone the repo. Go to your Github Repository, Click on the <> Code button, and Copy the URL · Go in Visual Studio Code.
🌐
Straygoat
straygoat.co.uk › freelance technical writer › blog › set up git and github to work with visual studio code
Set up Git and GitHub to work with Visual Studio Code - Straygoat
July 27, 2025 - Either select Clone Git Repository on the Welcome page or: i. Open the Command Palette. Press Cmd + Shift + P (Mac), Ctrl + Shift + P (Windows) ... Choose a folder on your computer where you want to save this repo.
🌐
Visual Studio Code
code.visualstudio.com › docs › sourcecontrol › overview
Source control in VS Code
November 3, 2021 - Work on an existing project: Clone a repository from a Git host. Browse without cloning: Use the GitHub Repositories extension for a virtual workspace. This workflow has different capabilities from a local checkout. To share an existing local repository, publish it or add a remote. Open the Source Control view (⌃⇧G (Windows, Linux Ctrl+Shift+G)) to review and commit changes.
🌐
Substack
jaredheinrichs.substack.com › jared’s technology substack › how to - clone a github repo in vscode
How To - Clone A GitHub Repo In VSCode - by Jared Heinrichs
July 17, 2025 - The first step is to locate the Repository you want to clone. Let’s go and use my public GitHub repo for HomeServarr. ... On the page, click on the big “Green” code button and copy the URL.
Top answer
1 of 2
1

You can do explorer.exe . in your terminal to see the absolute path of the folder you are currently in. It should be something like C:\<some more stuff here>.

If you want to clone the repository elsewhere, then make sure Powershell is open in your Terminal, cd into the folder you want it to be in and git clone it there. As an example:

cd C:\Users\<your windows username>\Documents\;
git clone https://github.com/Azure-Samples/cognitive-services-speech-sdk.git;

If the first line doesn't work then that means you're in a linux terminal for which you can do:

cd /C/Users/<your windows username>/Documents;
git clone https://github.com/Azure-Samples/cognitive-services-speech-sdk.git;
2 of 2
1

When cloning a repository with the command palette, VS Code clones the repo in the path specified in the setting git.defaultCloneDirectory (/home/vscode/ might be proposed because set in this config variable). If git.defaultCloneDirectory is not set, VS Code clones the repository in the user's folder. On Windows, this corresponds to C:\Users\<Your-User>\.

If you want to specify a path for git.defaultCloneDirectory, just go to File > Preferences > Settings and then, either search for git.defaultCloneDirectory, or browse to Extension > Git > Default Clone Directory.

As a side note, if you clone a repository from VS Code bash without supplying a destination directory, the repo is always cloned in the user's folder, even if git.defaultCloneDirectory is set. git.defaultCloneDirectory is used only with the command palette.

🌐
YouTube
youtube.com › watch
How to Clone Repositories from GitHub into VS Code - YouTube
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
Published: March 5, 2026
🌐
HackMD
hackmd.io › KuxRCUEjTGuwZHMoWV7BJw
Cloning a GitHub Repository and Editing in Visual Studio Code - HackMD
## Step 1: Clone the GitHub Repository Open your web browser and go to the GitHub repository you want to clone. Click on the "Code" button on the repository's main page. Copy the URL of the repository from the dropdown.
🌐
Visual Studio Code
code.visualstudio.com › docs › sourcecontrol › quickstart
Quickstart: use source control in VS Code
November 3, 2021 - Open the folder in VS Code with File > Open Folder.... If prompted, confirm that you trust this folder you created. Only trust other projects when you know their source. Learn about Workspace Trust. Open the Source Control view (⌃⇧G (Windows, Linux Ctrl+Shift+G)) and select Initialize Repository...
🌐
Digitalthoughtdisruption
digitalthoughtdisruption.com › home › blog › clone repository & push changes using visual studio code
Clone Repository & Push Changes using Visual Studio Code - Digital Thought Disruption
August 21, 2026 - If you are looking for an article on how to create the GitHub repository please see the following link: https://digitalthoughtdisruption.com/2020/09/09/create-a-repository-in-github/ ... When you refresh the GitHub repo you should see the new file and under Languages it even says that so far 100% of the files are in PowerShell · Summary: As you can see linking a repo and pushing updates from your local VS Code to your central repo on GitHub is pretty easy once you know what you are doing.
🌐
YouTube
youtube.com › watch
How to Clone Github Repository in Visual Studio Code - YouTube
In this video, you will learn how to clone a github repository in visual studio code. I hope you'll like the video and leave your feedback and suggestions fo...
Published: August 14, 2026