Visual Studio Code with sftp plugin upload ignored .git folder and .gitignore file

Viewed 3396

I have this sftp.json file:

{
    "name": "projectname",
    "remotePath": "/htdocs/",
    "host": "myhostdomain",
    "protocol": "ftp",
    "username": "user",
    "password": "pass",
    "passive": true,
    "watcher": {
        "files": "**/*",
        "autoUpload": true,
        "ignore": [
            ".vscode",
            ".git",
            ".gitignore",
            "config.php"
        ]
    }
}

It's really ignore the .vscode folder and config.php file, but not the .git and .gitignore

How can I fix this? The .git folder's changes generate massive network usage.

1 Answers

It's been three years since this question and I'm not sure if anyone still needs this answer.

Since I also fell into the same trap, leaving a possible solution here hoping it helps others. :)

According to the project's wiki page on github

The developer has updated setting field name, So your sftp settings need to be changed to

{
    "name": "projectname",
    "remotePath": "/htdocs/",
    "host": "myhostdomain",
    "protocol": "ftp",
    "username": "user",
    "password": "pass",
    "passive": true,
    "watcher": {
        "files": "**/*",
        "autoUpload": true,
    },
    "remoteExplorer": {
        "filesExclude": [
            ".vscode",
            ".git",
            ".gitignore",
            "config.php"
        ]
    }
}

I have tried this, and it works for me.

Related