Use sftp in VScode to transfer local files to the server

Install SFTP

Install sftp in the extension of VScode
Note that it needs to be installed when you are not connected to the server, that is, the machine needs to have sftp
insert image description here

Configure transport port

After the installation is successful, use the shortcut key " ctrl+shift+p ", enter sftp, select Config
insert image description here
to modify the configuration file according to your actual situation, mainly change the host and username , if there is no password, you can add one by yourself, so that you don't need to transfer it yourself enter password

insert image description here

host: the IP address of the workstation
port: the port of ssh
username: the username of the workstation itself
privateKeyPath: the configured key file stored locally for logging in to the workstation. Choose one of the following passwords (it can be in openssh format or ppk format)
password: the user password of the workstation itself. You can choose one of the key and the password; if you use the password, you don’t need to configure ssh on the workstation, but if you use the key, you need to configure ssh on the workstation, and you can fill in null for the password. protocol: protocol type, choose "sftp" by default remotePath
:
workstation The path of the folder that is synchronized with the local project needs to have the same name as the root directory of the local project file, and before uploading files using sftp, you must manually use mkdir to generate this root directory on the workstation, and other subdirectories under the root directory will automatically generate corresponding
ignore : Specify the files and folders to ignore when using sftp: sync to remote, note that there is a comma after each line, and there is no comma in the last line

transfer files

Select the file to be transferred to the server, right-click, select Uploadfile, and the file will be transferred to the file location you set in json
insert image description here

Guess you like

Origin blog.csdn.net/qin_liang/article/details/132640272