How To Fix No Remote Repositories Found in VS Code

The new Remote Repositories extension for Visual Studio Code created a new experience that enables working with source code repositories directly inside the VS Code environment.

How To Fix No Remote Repositories Found in VS Code

However, what happens if the remote repository you’re trying to change is not found? With cloning replaced by Remote Repositories support, you might run into issues with fatal errors.

In this article, we’ll go through different ways to fix this issue.

Fix #1: Set Remote Base URL

If you’re a newer programmer, the chances are that you might not have set the repo URL on your local repo.

To fix this issue, you’ll have to use the “git remote set” command. Here’s how it should look:

git remote set-url origin http://github.com/[Username]/[ProjectName].git
git add *.java
git commit -m "commit title"
git push origin master

The issue should be solved automatically.

Fix #2: Use the Correct URL

If the previous case isn’t the problem, then you should check that the URL you’re using is the correct one. Here’s how you can do that:

  1. Use the command: git remote -v
  2. The console should display what remote repository it is connected to by listing a URL that it uses to fetch and push changes in the form of
    origin http://github.com/[Username]/[ProjectName].git (fetch)
    origin http://github.com/[Username]/[ProjectName].git (push)

  3. If the URL doesn’t match what your GitHub displays, you’ll need to change it. You can use the remote set command to set the correct pathway:
    git remote set-url origin http://github.com/[Username]/[ProjectName].git

If this doesn’t fix the issue, you might need to check other causes.

Fix #3: Check Your Password

Your URL might not be the problem after all. You should check if your password has been changed recently.

If you’ve changed your password, you need to make sure that it has been obtained from the credential manager on Mac or Windows or keychain access.

It can happen that the old password is still used, and the new one is not cached yet. If that’s the case, all github.com credentials should be removed immediately.

Here’s how to clear git-related info from Mac and Windows.

Mac:

  1. Go to Keychain Access.
  2. Navigate your password.
  3. Delete all keys that are connected to the source control.

Windows:

Follow the commands:

$ git credential-manager uninstall
$ git credential-manager install

Fix #4: Temporary Fix (Not Recommended in the Long Run)

Mac:

If there’s no GitHub entry present in the keychain access, then you can clone the app with the following:

git clone https://username@github.com/org/repo.git

Use this info:

  • Username with your GitHub username
  • Org with your organization name
  • Repo with your repository name

Windows:

Stick to the following steps:

  1. Access the git folder.
  2. Open the “config” file with notepad (or notepad++) or another editor.
  3. Change your URL to https://username:password@github.com/username/repo_name.git
  4. Save the code and push it.

Other Issues and Common Fixes

If you’re not a collaborator, then it’s possible that you can successfully authenticate your access on GitHub, but still can’t clone or push the changes.

The other problem is that there might be some spelling issues on your side. This might seem trivial, but a misplaced letter is all it takes.

Another issue can be related to git remove -v. It can be set to use HTTPS, but your repo doesn’t points to SSH. If that’s the case, you need to remove the “ssh” part and replace it with “https://.”

The last issue would be that the repository is deleted. In that case, there’s not much you can do but go directly to GitHub and check the project status for any changes.

FAQs

How much RAM is enough for a VS code?

The VS code is considered lightweight and should run on your hardware without any problems. The recommended storage is 1GB.

Should you install the VS code on SSD or HDD?

The SSD has a quality IO, so it’s recommended that you install your VS code on your SSD disk.

Can you use the VS code offline?

Yes. The code can be used offline. You just need to install Microsoft extensions.

Top Off

Remote access has worked great for most users, but there’s still a chance of error when trying to push changes directly to a repository. We hope you’ve been able to fix the issue.

Have you found another solution to missing repositories problem in VS Code? Let us know in the comments.

Disclaimer: Some pages on this site may include an affiliate link. This does not effect our editorial in any way.