部分文章内容为网上转载整合,并在博客中记录,以便查阅,部分原文出处未进行标注,如有侵权,请联系我,谢谢。邮箱地址:gnivor@163.com ►►►需要气球么?请点击我吧!

vscode远程代码同步

参考资料:

https://blog.csdn.net/u012560340/article/details/83030680

https://github.com/liximomo/vscode-sftp/issues/469

 

首先下载sftp插件

cmd+shift+p->输入SFTP:Config打开配置文件

 

同一项目下文件上传到多个sftp服务器:

 

{
        "name" : "linux",
        "protocol": "sftp",
        "port": 36000,  //服务端sftp端口
        "context": "/local/project1", //本地映射文件夹路径
        "remotePath": "/home/username/project1",  //服务器映射路径
        "uploadOnSave":true,
        "ignore": [
            ".vscode",
            ".git",
            ".gitignore",
            ".DS_Store"
        ],
        "profiles": {
            "user1":{
                "host": "100.100.100.100",
                "username": "username1",   //服务器用户名
                 "password":"password1"     //服务器密码
            },
            "user2":{
                "host": "200.200.200.200",
                "username": "username2",   //服务器用户名
                 "password":"password2"     //服务器密码
            }
        }
    }    

 

 

 

 

不同项目下文件上传到同一个sftp服务器的不同文件夹:

[
    {
        "name" : "linux",
        "protocol": "sftp",
        "port": 36000,
        "host": "100.100.100.100",
        "username": "username",   //服务器用户名
        "password":"password",      //服务器密码
        "context": "/local/project1", //本地映射文件夹路径
        "remotePath": "/home/username/project1",  //服务器映射路径
        "uploadOnSave":true,
        "ignore": [
            ".vscode",
            ".git",
            ".gitignore",
            ".DS_Store",
            "__pycache__",
            ".remote-sync.json",
            "*.zip",
            "*.pptx",
            "*.msg"
        ] 
    },
    {
        "name" : "linux",
        "protocol": "sftp",
        "port": 36000,
        "host": "100.100.100.100",
        "username": "username",
        "password":"password",
        "context": "/local/project2",
        "remotePath": "/home/username/project1",
        "uploadOnSave":true
    }    
]           

 

uploadOnSave为修改后保存自动上传,也可=false,然后修改之后,在项目中右键修改的文件/目录,upload指定的文件即可

 

posted @ 2019-10-14 11:04  流了个火  阅读(4610)  评论(0编辑  收藏  举报
►►►需要气球么?请点击我吧!►►►