我希望忽略我的代码库中可能出现的所有.vscode
目录,除了顶层目录。在顶层目录中,我想要忽略除launch.json
之外的所有文件。
我尝试过无数次:
**/.vscode/
!/.vscode/
/.vscode/*
!/.vscode/launch.json
**/.vscode/
!/.vscode/
!/.vscode/launch.json
**/.vscode/
!/.vscode/launch.json
**/.vscode/*
!/.vscode/launch.json
**/.vscode/
/.vscode/!launch.json
launch.json
没有被之前添加到源代码控制中。.gitignore
只能针对未跟踪的文件起作用 :) 如果它已经被跟踪了,请运行git rm -r --cached .vscode/launch.json
并提交其删除。 - qslabs.vscode
替换为./vscode/*
或./vscode/**
,问题就会解决。 - undefined