Tech

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
    VS Code No Remote Repositories Found 9
  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)

    VS Code No Remote Repositories Found 10
  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
    VS Code No Remote Repositories Found 11

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.
    VS Code No Remote Repositories Found 3
  2. Navigate your password.
    VS Code No Remote Repositories Found 1
  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://[email protected]/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.
    VS Code No Remote Repositories Found 2 1
  2. Open the “config” file with notepad (or notepad++) or another editor.
    VS Code No Remote Repositories Found 5
  3. Change your URL to https://username:[email protected]/username/repo_name.git
    VS Code No Remote Repositories Found 6
  4. Save the code and push it.
    VS Code No Remote Repositories Found 7

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.

Muhabarishaji

🧪 |Medical Laboratory Scientist 🥇 | Mindset over Everything. 
 🤝 | Let's Grow Together.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button