本文主要是介绍vscode中通过WSL使用rsync进行同步,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1. Download WSL
- 参考:https://docs.microsoft.com/en-us/windows/wsl/install-manual
- 可直接手动下载(如下图所示)注:也可选择命令行下载
2. Enable WSL
- 法一:管理员权限运行Powershell后执行命令:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
- 法二:参考 https://www.jiloc.com/45016.html
- 注:enable后需重启电脑才能生效
3. Installing WSL
- 管理员权限运行Powershell后执行命令:
Add-AppxPackage .\app_name.appx
- 参考1:https://docs.microsoft.com/en-us/windows/wsl/install-win10
- 参考2:https://docs.microsoft.com/en-us/windows/wsl/install-manual
- 参考2:https://docs.microsoft.com/en-us/windows/wsl/initialize-distro
4. Usage
- 安装完后输入用户名和密码
- 执行sudo apt update && sudo apt upgrade
5. vscode中配置
- vscode中下载sync-rsync插件
- json配置如下
"sync-rsync.exclude": [".git",".vscode",".ccls-cache","bin/","build/","lib/","log/",".gitignore","eco.srctrl*"],"sync-rsync.shell": "ssh -p port","sync-rsync.remote": "ouzh@ip:/home/ouzh/workspace/sync/model/","sync-rsync.local": "F:\\TAD2x_develop\\7-test_dataset\\rain_test\\2019-07-29\\model\\rnet\\","sync-rsync.onSaveIndividual": true,"sync-rsync.executableShell": "C:\\Windows\\System32\\bash.exe","sync-rsync.useWSL": true,
- 参考:https://visihow.com/Install_VSCODE_Visual_Studio_Code_SyncRsync_on_Windows_10_Using_WSL_Windows_Subsystem_for_Linux
这篇关于vscode中通过WSL使用rsync进行同步的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!