在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:vscode-sftp开源软件地址:https://gitee.com/liushuai05/vscode-sftp开源软件介绍:sftp sync extension for VS Code以下内容均为第三方软件翻译将本地目录与远程服务器目录同步。允许您选择在本地保存文件后编辑将文件上载到远程目录。这允许您或多或少地直接在服务器上编辑类似于winscp或其他类似的程序。 动力很好,功能也很好。非常简单,只需要三行配置!很快,一眨眼就完成了。
使用如果您的最新文件在服务器上,您可以从一个空的本地文件夹开始,然后下载您的项目,然后从该点同步。
例如: { "name": "Profile Name", "host": "name_of_remote_host", "protocol": "ftp", "port": 21, "secure": true, "username": "username", "remotePath": "/public_html/project", <---- This is the path which will be downloaded if you "Download Project" "password": "password", "uploadOnSave": true} password参数是可选的,但是如果不添加它,系统会不断提示您输入密码。请注意,必须用反斜杠转义任何反斜杠和其他特殊字符。 下面还有其他配置示例。
详细用法。请转到 wiki. 配置示例你可以在这里看到完整的配置 here. 简单配置{ "host": "host", "username": "username", "remotePath": "/remote/workspace"} 配置文件{ "username": "username", "password": "password", "remotePath": "/remote/workspace/a", "watcher": { "files": "dist/*.{js,css}", "autoUpload": false, "autoDelete": false }, "profiles": { "dev": { "host": "dev-host", "remotePath": "/dev", "uploadOnSave": true }, "prod": { "host": "prod-host", "remotePath": "/prod" } }, "defaultProfile": "dev"} _注意:只有在根级别才能使用“context”和“watcher”。 使用“sftp:set profile”切换配置文件。 多个配置上下文配置必须不相同。 [ { "name": "server1", "context": "project/build", "host": "host", "username": "username", "password": "password", "remotePath": "/remote/project/build" }, { "name": "server2", "context": "project/src", "host": "host", "username": "username", "password": "password", "remotePath": "/remote/project/src" }] _注意:此模式下需要使用“name”。 连接跳变您可以通过带有ssh协议的代理连接到目标服务器。_注意:变量替换在跃点配置中不起作用** 单跳local -> hop -> target { "name": "target", "remotePath": "/path/in/target", // hop "host": "hopHost", "username": "hopUsername", "privateKeyPath": "/Users/localUser/.ssh/id_rsa", // The key file is assumed on the local. "hop": { // target "host": "targetHost", "username": "targetUsername", "privateKeyPath": "/Users/hopUser/.ssh/id_rsa", // The key file is assumed on the hop. }} 跳频通信local -> hopa -> hopb -> target { "name": "target", "remotePath": "/path/in/target", // hopa "host": "hopAHost", "username": "hopAUsername", "privateKeyPath": "/Users/hopAUsername/.ssh/id_rsa" // The key file is assumed on the local. "hop": [ // hopb { "host": "hopBHost", "username": "hopBUsername", "privateKeyPath": "/Users/hopaUser/.ssh/id_rsa" // The key file is assumed on the hopa. }, // target { "host": "targetHost", "username": "targetUsername", "privateKeyPath": "/Users/hopbUser/.ssh/id_rsa", // The key file is assumed on the hopb. } ]} 用户配置中的设置可以使用“remote”告诉sftp从[remote fs]获取配置(https://github.com/liximomo/vscode-remote-fs).在用户设置中: "remotefs.remote": { "dev": { "scheme": "sftp", "host": "host", "username": "username", "rootPath": "/path/to/somewhere" }, "projectX": { "scheme": "sftp", "host": "host", "username": "username", "privateKeyPath": "/Users/xx/.ssh/id_rsa", "rootPath": "/home/foo/some/projectx" }} In sftp.json: { "remote": "dev", "remotePath": "/home/xx/", "uploadOnSave": true, "ignore": [".vscode", ".git", ".DS_Store"]} 远程资源管理器远程资源管理器允许您在远程中浏览文件。您可以通过以下方式打开远程资源管理器:
只能使用远程资源管理器查看文件内容。运行命令 调试
捐赠如果这个项目帮助你减少了开发时间,你可以给我一杯咖啡:) 微信支付宝PayPal |
请发表评论