--- title: 'VSCode 套件 - sftp' disqus: hackmd --- VSCode 套件 - sftp === ![downloads](https://img.shields.io/github/downloads/atom/atom/total.svg) ![build](https://img.shields.io/appveyor/ci/:user/:repo.svg) ![chat](https://img.shields.io/discord/:serverId.svg) ## Table of Contents [TOC] ## 用途 先來說說以前遇到的不便之處吧!!!就是自己本機弄完,還要透過打開其他工具再把它傳上去,但設定這個之後他所有都幫你弄上去了。 其實有好有壞拉!!!覺得測試機可以這樣做,但正式機還是確保可以再丟上去比較好。版控也要做好。 所以來試試透過這個套件sftp來讓資料自動同步。 Step 1 安裝sftp --- 1. 先到VSCode延伸模組 2. 搜尋 Sftp 3. 安裝 Step 2 產生sftp config --- 1. 先切到專案 2. 按下F1, 輸入sftp 3. 按下搜尋列表SFTP: Config產生資料夾(.vscode/sftp.json) Step 3 設定sftp.json檔 --- ```gherkin= { "name": "My Server", "host": "網址", "protocol": "sftp", "port": 22, "username": "帳號", "password": "密碼", "remotePath": "想要同步的路徑", "uploadOnSave": true, "ignore": [ ".vscode", ".git", ".DS_Store" ], "watcher": { "files": "**/*", "autoUpload": true, "autoDelete": false } } ``` > 然後修改的東西都會同步上去喔!!!! > .vscode/sftp.json不上版控(看自己習慣) > 如果需要多組同步,就把內容改成array ## Appendix and FAQ :::info **Find this document incomplete?** Leave a comment! ::: ###### tags: `VSCode` `sftp`