Dominik Muranowski
Dominik Muranowski

Reputation: 3

How to edit code on server directly in VScode

I am writing code that will be deployed to a server. Right now I have to upload the code each time I change it. Is there any way to edit the code live on the server in Visual Studio code?

Upvotes: 0

Views: 3169

Answers (3)

Brebber
Brebber

Reputation: 3084

As there are some extension in the editor who provide that function this can be done in VS Code very simple. Just search in extensions for Keyword 'FTP' ...

Two Examples:

https://marketplace.visualstudio.com/items?itemName=humy2833.ftp-simple
https://marketplace.visualstudio.com/items?itemName=lukasz-wronski.ftp-sync

Both are very popular.

At the moment I personally use FTP-Simple. But have a look on your own. It depends on the things you wonna do. And don't worry ... it's a little bit tricky at the beginning to figure out how to setup and how they work ... but when you are in it works fine.

Upvotes: 1

stygarfield
stygarfield

Reputation: 127

This is what I use to connect remotely to a couple Raspberry Pis, and a home server.

https://code.visualstudio.com/docs/remote/ssh

Upvotes: 0

atultw
atultw

Reputation: 1021

It depends what hosting you are deploying to. You can SSH into your server with most providers and use a command line editor such as nano or vim. Keep in mind, this won't keep the version on your computer up to date and the changes will be overwritten if you redeploy. Alternatively, If you have a VPS and want to edit the files in an IDE on your local computer, maybe a file transfer system like FTP or SMB would work. I don't suggest it though, there are huge security issues with them.

For Azure web apps, I've found that the Azure plugin for VScode is a quick and easy way to deploy my app. It's not quite real time but it's very easy to redeploy after updating. https://code.visualstudio.com/docs/azure/extensions

Upvotes: 0

Related Questions