安装SFTP插件
首先在VScode中下载安装插件SFTP
配置SFTP
Windwos下Ctrl+Shift+P,输入SFTP: config命令并运行,进入sftp.json配置项如下:
{
"name": "站点名称",
"host": "ip地址",
"port": 22,
"username": "登录名",
"password": "登录密码",
"protocol": "sftp",
"agent": null,
"privateKeyPath": null,
"passphrase": null,
"passive": false,
"interactiveAuth": true,
"remotePath": "需要打到的远程的文件夹地址",
"uploadOnSave": true,
"syncMode": "update",
"ignore": [
"**/.vscode/**",
"**/.git/**",
"**/.DS_Store"
],
"watcher": {
"files": "glob",
"autoUpload": true,
"autoDelete": true
}
}
操作说明
右键项目面板,选择从ftp服务器下载或者上传至ftp服务器
更改文件时保存自动上传