Visual Studio Code with sftp 插件上传忽略了 .git 文件夹和 .gitignore 文件



我有这个sftp.json文件:

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

它真的忽略了.vscode文件夹和config.php文件,而不是.git.gitignore

我该如何解决这个问题?.git 文件夹的更改会产生大量的网络使用量。

这个问题已经三年了,我不确定是否有人仍然需要这个答案。

因为我也落入了同样的陷阱,在这里留下一个可能的解决方案,希望它能帮助别人。 :)

根据该项目在github上的维基页面

开发者更新了设置字段名称,所以你的sftp设置需要改为

{
"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"
]
}
}

我已经尝试过这个,它对我有用。

以下配置对我有效:


{
"name": "My Server",
"uploadOnSave": true,
"ignore": [
".git",
".gitignore"
]
}

最新更新