在vs code中使用ftp-sync插件实现客户端与服务器端代码的同步

在vs code中使用ftp-sync插件实现客户端与服务器端代码的同步

下载安装 vscode-ftp-sync 插件。


  • 安装方法1. Ctrl+Shift+P 输入 ext install [插件关键字/名称]
  • 安装方法2. Ctrl+Shift+P (或F1) 输入 Extensions, 选中 Install Extension然后输入插件名称/关键字 

若安装不在插件商店的插件, 则可以放置到用户目录下的 .vscode/extensions 文件夹中。然后重启 VS Code 即可生效

配置 ftp-sync

  • 然后好ftp-sync插件之后,在 Ctrl+Shift+P (或 F1) 输入 * Ftp-sync: Init *,配置服务器账号路径等信息。
{
    "remotePath": "/var/data/",
    "host": "192.168.0.78",
    "username": "shoukii",
    "password": "shouadmin",
    "port": 22,
    "protocol": "sftp",
    "uploadOnSave": true,
    "passive": false,
    "debug": false,
    "privateKeyPath": null,
    "ignore": [
        "\\.vscode",
        "\\.git",
        "\\.idea"
    ]
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

该配置信息在当前目录的 ./.vscode/ftp-sync.json 文件中。

  • 通过命令 Ftp-sync: Sync Local to Remote 和 Ftp-sync: Sync Remote to Local 同步服务器端和客户端的文件。

  • 通过命令 commit 提交修改。

更详细的插件使用说明参考 https://github.com/lukasz-wronski/vscode-ftp-sync“>vscode-ftp-sync。

猜你喜欢

转载自blog.csdn.net/simple_tifa/article/details/79787789