Can I see my server files and GitHub repo together in VS Code?

November 19, 2026 4 answers
Asked by _e72~torkeli.5

I can connect VS Code to my company's server with Remote SSH, and I also need to work with a GitHub repository. How can I see both sets of files at once and make pull requests?

Answers

2f!brackenpouch_463

The simplest setup is usually to clone the repository onto the server, then open it in your Remote SSH window. In the remote terminal, run git clone with your repository's SSH or HTTPS address. You'll need permission to access the repo and authentication configured for Git on the server.

Open the cloned folder in VS Code, then use File > Add Folder to Workspace to add the other server folder. Both should appear in the Explorer. You can commit and push using Source Control or the terminal, then open a pull request on GitHub.

_e72~torkeli.5:

Does that mean the repository files are actually stored on the server too?

Tavmexo.9r:

Yes. The clone is a working copy on the server. Changes stay there until you commit and push them to GitHub.

Reply to this answer
q.529+ferrulevisor

A useful distinction: Git can use SSH to talk to GitHub, but that isn't the same as opening an interactive SSH session to a server. Cloning gives you files in a place VS Code can browse. Git then exchanges changes with GitHub when you fetch, pull, or push.

Reply to this answer
_m61~zavquelo.8

If you don't want a clone on the server, use two VS Code windows: one connected to the server and another with a local clone of the repository. You can keep them side by side, though edits in one location won't automatically appear in the other.

Reply to this answer
p.531!marlvexo

Two terminals are another option if you only need to inspect or run commands in both places. They won't put both sets of files in the Explorer, though, so the workspace approach is better if you want to browse and edit them together.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions