New VS Code Tool Eases GitHub Browsing/Editing, No Cloning Required

A new Remote Repositories preview extension lets developers working in Visual Studio Code remotely browse and edit GitHub repos, without having to clone them locally and then open them up in the popular, open source-based code editor.

After Microsoft acquired GitHub some three years ago, it has been strengthening the ties between the code-repository service and its dev tooling.

Remote Repositories is the latest example of that, with its VS Code marketplace description stating it "lets you quickly browse, search, edit, and commit to any remote GitHub repository directly from within Visual Studio Code." Normally, developers would need to clone a repo to their local machine and then open it up to work with its code. "Cloning repos takes time and maintenance, as your local copy can quickly become out of date if you don't pull changes regularly. Plus, if you don't know the codebase you're cloning, there may be security risks involved too!" the site says.

Remote Repositories
[Click on image for larger view.] Remote Repositories (source: VS Code Marketplace).

Scenarios where the new tool can be put to use include:

  • To browse, learn, or search a codebase or parts of one, either as it exists today or at any point in history, directly in VS Code.
  • To create, edit, and review documentation, blog posts, notes, etc., using VS Code's powerful Markdown editor.
  • To make changes that don't require building or running tests, although validations can still run in GitHub Actions triggered on commit.
  • To quickly review pull requests (PRs), without having to check-out or in any way affect your local setup.

While the tool in its preview stage now works just with GitHub, Microsoft says support for Azure repos is coming soon.

Also, there are limitations to its functionality, including:

  • Debugging, terminals, and tasks: Not currently supported. Terminals open on your local file system and don't have access to the virtual file system of the remote repository.
  • Limited language intelligence: Features like IntelliSense and Go to Definition may be impacted as many languages don't yet understand the virtualized environment of Remote Repositories.
  • Search: GitHub search itself has limitations, such as not indexing branches. Remote Repositories can avoid this limitation and perform a full-text search by enabling indexing. Indexing pulls a shallow clone of the repository from GitHub and performs a full search locally, providing greater power than GitHub's fuzzy default-branch native search. You can enable indexing in Remote Repositories from the Search view.
  • Extension limitations: Not all extensions can support running in a virtual workspace, but more extensions will support it over time. Extensions that depend heavily on access to local files cannot support this setup.

"We are just getting started on this journey, so expect the feature set to grow and the limitations to shrink as we continue development," Microsoft said in a June 10 announcement. As of this writing, it has been installed more than 14,000 times.

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus


Subscribe on YouTube