Okay, this may seem pretty late, but if you're finding it difficult to ignore .vscode/
without including any sub-file, you could just ignore the directory:
.vscode/
and then manually track the file you want:
git add -f .vscode/launch.json
The -f
adds files even when they're ignored. Once Git sees changes to .vscode/launch.json
you'll be prompted to commit them just like any other file.
this actually worked for me, caused i experience the same issue, trying to ignore the .vscode/
path, without including a sub-file settings.json