VS Code & Remote Repositories

Using the Remote Repositories Extension in VS Code

I spend a lot of my day in VS Code, but not too much in GitHub because I don’t work on any joint projects. I do use a local Git repository for my code. It’s easy to see when others have made changes so that I can hunt them down speak politely to them about stopping.

In any case, I was watching An Introduction to Visual Studio Code and GitHub when I learned about the Remote Repositories (GitHub) extension for VS Code. You can directly edit a repository on GitHub without having to clone it locally.

Disclaimer I must confess that in the process of using Remote Repository access this week, I managed to lose/erase 6 files that I hadn’t committed, but maybe you’re more of a git savant than I am, and you’ll have no problems.

Let’s look at how to get this installed and integrated with VS Code:

  1. Load VS Code
  2. Open Extensions (CTRL+SHIFT+X)
  3. Search for Remote Repositories (GitHub). Install it.
  4. Open the Command Palette (CTRL+SHIFT+P)
  5. Type in Remote Repositories: Open Repository
  6. Select Open Repository from GitHub
  7. You’ll be prompted to allow access to GitHub. Allow it.
  8. A browser window will open. Click Continue to authorize access to GitHub.
  9. Sign in to GitHub. If you don’t already have an account, there won’t be any repositories for you to open in VS Code, will there?
  10. You should receive a ‘Success!’ webpage, with an authorization token on it.
    • If your browser prompts you to Open Visual Studio Code, do so. It’ll save you the trouble of manually entering the authorization code. Once VS Code opens again, you’ll be prompted to Allow an extension to open this URI. Permit it, and VS Code will complete the link.
    • If the browser didn’t prompt, copy the authorization token. You’ll have to paste it into VS Code manually. The Command Palette field should be asking for the token, so paste it in.
  11. VS Code should now be able to open your repositories directly on GitHub.
Built with Hugo
Theme Stack designed by Jimmy