V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
nyxsonsleep
V2EX  ›  Visual Studio Code

vscode 怎么排除.vscode 文件夹

  •  
  •   nyxsonsleep · 142 天前 · 977 次点击
    这是一个创建于 142 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

    7 条回复    2024-02-03 23:09:49 +08:00
    9
        1
    9  
       142 天前   ❤️ 1
    在 .gitignore 写入

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

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

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

    不仅 ide 相关的文件,操作系统相关的文件(*.DS_Store ,Thumbs.db )也得在这里排除掉
    fpure
        7
    fpure  
       84 天前
    @nyxsonsleep 你彷佛对.gitignore 的用法有什么误解,特定 ide 的文件就应该写进.gitignore 里面
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   894 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 22:01 · PVG 06:01 · LAX 15:01 · JFK 18:01
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.