参考链接:vscode+sftp开发模式环境的同步,https://segmentfault.com/a/1190000011844958
- 安装sftp插件
- 打开一个目录, ctrl + p, >sftp -> config 进行配置
- 配置远程服务器的ip和port之后,修改文件并测试是否同步到远程文件
{
"host": "127.0.0.1",
"port": 22,
"username": "root",
"password": "password",
"protocol": "sftp",
"agent": null,
"privateKeyPath": null,
"passphrase": null,
"passive": false,
"interactiveAuth": true,
"remotePath": "/home/xxx/dir",
"uploadOnSave": true,
"syncMode": "update",
"ignore": [
"**/.vscode/**",
"**/.git/**",
"**/.DS_Store"
],
"watcher": {
"files": "glob",
"autoUpload": true,
"autoDelete": true
}
}