如何使用VSCode远程编辑网站文件? [英] How to use VSCode to remotely edit website files?

查看:431
本文介绍了如何使用VSCode远程编辑网站文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要能够远程登录客户端的Web服务器并远程编辑代码.我主要将其用于CSS更改,但也开始使用PHP.

I need to be able to remotely log into web servers for my clients and edit code remotely. I mostly use this for CSS changes, but also am starting to play with PHP as well.

我试图使Remote-Editor正常工作,但它不会拾取放置在/home文件夹中的.remote文件.这些说明并没有真正提供有关设置的详细信息.

I have tried to get Remote-Editor to work but it won't pick up the .remote file that I placed in the /home folder. The instructions don't really give great details on setting this up.

我该怎么办?

推荐答案

使用FTP客户端(例如 FileZilla ),然后将VSCode设置为默认编辑器.每当您打开文件时,它将在VSCode中打开它.我强烈建议您将所有代码下载到您自己的计算机上,并将其用作开发环境,然后,在完成更改后,备份您的站点,然后将修改后的文件一起上传.不需要在您自己的计算机上编辑文件,但是如果您出于某种原因(例如您在代码中犯了错误,而现在却无法正常工作)需要恢复到旧版本,则建议您这样做.

Use an FTP client (like FileZilla), then set VSCode as the default editor. Anytime you open a file, it will open it in VSCode. I highly recommend that you download all of the code to your own computer and use it as a dev environment, and then, when you're finished with your changes, backup your site, then upload the modified files together. It's not required to edit files on your own machine, but it is recommended if you ever need to revert to an old version for whatever reason (like you made a mistake in the code, and now nothing works right).

或者,您可以使用扩展名,例如 FTP同步进行本地编码,并自动为您同步文件.

Alternatively, you can use an extension like FTP Sync to code locally, and have the files be automatically synced for you.

这篇关于如何使用VSCode远程编辑网站文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆