0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

VSCodeでFTP(S)経由によるファイル自動アップロード

Last updated at Posted at 2023-08-29

Extensions(Ctrl + Shift + X)からnatizyskunk.sftpを入力し、SFTPをインストール

image.png

Ctrl + Shift + Pを推しftpと入力し、SFTP: Configを開く

image.png

Configを書いて保存

{
    "name": "My Server",
    "host": "sv14460.xserver.jp",
    "protocol": "ftp",
    "port": 21,
    "username": "test@xs679698.xsrv.jp",
    "password": "your password",
    "remotePath": "/xs679698.xsrv.jp/public_html/",
    "uploadOnSave": true
}

必須項目

host

image.png

protocol

ftp

port

21
https://www.xserver.ne.jp/manual/man_ftp_spec.php

username

image.png

password

image.png

remotePath

image.png

uploadOnSave

trueにすると保存時に自動アップロードされます

ファイルを保存して自動アップロード

FTPS

"secure": trueに設定する

{
    "name": "My Server",
    "host": "sv14460.xserver.jp",
    "protocol": "ftp",
    "port": 21,
    "secure": true,
    "username": "test@xs679698.xsrv.jp",
    "password": "your password",
    "remotePath": "/xs679698.xsrv.jp/public_html/",
    "uploadOnSave": true
}

.vscode/と.git/を除外する

.vscode\sftp.jsonにパスワード記載してるなら除外しましょう

{
    "name": "My Server",
    "host": "sv14460.xserver.jp",
    "protocol": "ftp",
    "port": 21,
    "secure": true,
    "username": "test@xs679698.xsrv.jp",
    "password": "your password",
    "remotePath": "/xs679698.xsrv.jp/public_html/",
    "uploadOnSave": true,
    "ignore": [
        ".vscode",
        ".git"
    ]
}
0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?