vscode 怎么排除.vscode 文件夹

154 天前
 nyxsonsleep

尝试过 files.exclude 和 files.watchexclude 添加**/.vscode都没效果。

具体情况:我的 vscode 有插件有时会创建一个 settings.json 文件,会在 source control 里显示。

1002 次点击
所在节点    Visual Studio Code
7 条回复
9
154 天前
在 .gitignore 写入

.vscode/
xiaojun996
154 天前
1. 想要在 vscode 的 Explorer 隐藏,需要在当前 vscode 打开的 root 下添加 .vscode/settings.json 文件,并在里面加上:

```json
{
"files.exclude": {
".vscode": true
}
}
```

2. 想要在 vscode 的 Source Control 里看不到,其实就是在 .gitignore 里添加 .vscode
nyxsonsleep
154 天前
@9 不希望在.gitignore 中加入这种特定 ide 的文件。我记得 idea 就单独有自己的管理不用插入到.gitignore 中
nyxsonsleep
154 天前
@xiaojun996 看来是没其他方法了。
deorth
153 天前
不支持
9
153 天前
@nyxsonsleep 额,有洁癖么。.gitignore 就是做这个事情的呀,随便看下 GitHub 上带 .gitignore 的都是这样写的

不仅 ide 相关的文件,操作系统相关的文件(*.DS_Store ,Thumbs.db )也得在这里排除掉
fpure
96 天前
@nyxsonsleep 你彷佛对.gitignore 的用法有什么误解,特定 ide 的文件就应该写进.gitignore 里面

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/998375

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX