VS Code .gitignore Template

The full, current VS Code .gitignore template — copy it as-is, or head to the .gitignore Generator to merge it with other stacks into one file.

Template

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
!*.code-workspace

# Built Visual Studio Code Extensions
*.vsix

What each entry does

Why every line in this template is excluded, not just what it matches.

Entry Why it's excluded
.vscode/* Excludes .vscode/* — generated or machine-specific for this stack, not something to track in version control.
!.vscode/settings.json Re-includes .vscode/settings.json — carves out an exception to a broader exclusion pattern above it.
!.vscode/tasks.json Re-includes .vscode/tasks.json — carves out an exception to a broader exclusion pattern above it.
!.vscode/launch.json Re-includes .vscode/launch.json — carves out an exception to a broader exclusion pattern above it.
!.vscode/extensions.json Re-includes .vscode/extensions.json — carves out an exception to a broader exclusion pattern above it.
!.vscode/*.code-snippets Re-includes .vscode/*.code-snippets — carves out an exception to a broader exclusion pattern above it.
!*.code-workspace Re-includes *.code-workspace — carves out an exception to a broader exclusion pattern above it.
*.vsix Files matching *.vsix — a generated or machine-specific file type for this stack, safe to regenerate rather than track.