Edit remote Linux files in VS Code directly.
Note
Only support remote Linux machine. Some functionality (like file watching) may not work well on other operating system (like FreeBSD).
Features
- Edit remote Linux files in VS Code directly without temporary file involed.
- Extremely fast & low-cost file watching to detect remote file system changes.
- Convenient uploading/downloading with progress reporting & cancellation.
Commands
VSC: 1.52.1 SFTP: 1.12.9 (liximomo extension) windows 8 After to complete my sftp.json (see in Image) and ctrl+s,i have 'done login.vue' but I don't get the display in my brows. Being able to connect to a web server and make changes without having to download files, open them with a code editor and then having to re-upload is a big t.
All commands are grouped in SFTP
category.
In VS Code, select Remote-SSH: Connect to Host. From the Command Palette ( F1) and use the same user@hostname as in step 1. If VS Code cannot automatically detect the type of server you are connecting to, you will be asked to select the type manually. In this vlog learn how to add FTP extension in your visual studio code and save and sync file and folder from remote server in visual studio code.FTP extensi. VS Code Download: for watching!
SFTP: Open Folder
to open remote folderSFTP: Add Folder
to add remote folder into workspaceSFTP: Open File
to open remote fileSFTP: Download
to download remote file/folder- For non-Windows users,
SFTP: Upload
to upload file/folder to remote - For Windows users,
SFTP: Upload Folder
to upload folder to remote - For Windows users,
SFTP: Upload File
to upload file to remote SFTP: Remove Configuration
to remove SSH credential information stored in VS CodeSFTP: Help
to show this help document
SSH credential configuration
SSH credential configuration could be required during processing, with the following json format:
'port'
: use 22 as default'privateKeyFile'
: please use absolute path'port'
,'username'
and one of ['password'
,'privateKeyFile'
] are necessary.'passphrase'
is also necessary if your'privateKeyFile'
needs it.
Note
The credential configurations are stored without encryption in VS Code, including 'host'
, 'port'
, 'username'
, 'password'
, 'passphrase'
and privateKey from 'privateKeyFile'
. You can use SFTP: Remove Configuration
to remove configurations.
Quick Start
1. Trigger command
Trigger related command by Command Palette
, Explore Context Menu
or Editor Context Menu
.
2. Input SSH Credential
After choosing the Add New SFTP Configuration
option, the credential information is required by asking user to edit a temporary json file.
3. Select Remote File/Folder
Remote resource is selected by showing user a popup quick-pick widget. Only file, folder and symbolic link to a file/folder are showed in the widget.
- Pick
. (Confirm Current Folder)
option to confirm selecting current folder. - Pick
Create New Folder
to create a new folder. - Pick folder name to browse into the folder.
- Pick file name to select the file.
4. Open Folder Example
Known Issues
1. Failed to create symbolic link on Windows
Symbolic links are ignored on Windows when in a downloading folder, since Windows need Admin permisstion to create them.
See https://github.com/nodejs/node-v0.x-archive/issues/2274.
2. Failed to handle remote files when file name contains
Linux file name could contain , but it would be treated as path seperator in VS Code.
Thanks
Sincerenly thanks to these people who have contributed to this extension.
gsun4
Enjoy!
How to Use sftp Extension in VS Code
After install SFTP on Visual Studio Code as my post before Using SFTP on Visual Studio Code now i’ll show how to using SFTP on Visual Studio Code in my lil project.
After installing the extension, let’s see how to use this extension. Open the project in the editor. You can do this from File->Open Folder and select your project directory.
Press the Ctrl+Shift+P if you are on Windows/Linux or Cmd+Shift+P on Mac which opens a command palette. Type SFTP and select the SFTP:config option.
It will open the sftp.json file in the editor. You will get the content like below in the sftp.json file.
Fill the details like protocol, host, username, remotePath, etc. Port is default to 22. You can change it if you are using another port. I recommend keeping the “uploadOnSave” value as false so the file will not upload automatically on saving it. While using the extension, make sure your local project and remote project have the same files and folders structure.
Visual Studio Publish Sftp
Once you enter the details save the file. sftp.json file saved in your project root directory under the .vscode folder. This file is for a single project. For another project you need to follow the same steps and set a sftp.json file.
Vs Code Ftp Sync
Because im already have offline file on my PC and i want to sync from Local To Remote, so ill using command SFTP : Sync Local > Remote. To do that open command palette : press the Ctrl+Shift+P if you are on Windows/Linux or Cmd+Shift+P on Mac and choose SFTP : Sync Local > Remote, you can type SFTP first to filter command. After that you must choose JSON Name that already setting before. You can see SFTP Process in bottom side Visual Studio Code.
Configure Sftp On Visual Studio Code
Done. Now you cant explore all command in SFTP