Git Ignore VS Code Workspace settings

When you add a lot of workspace or project specific VS Code settings files, Git likes to try and track those files. This is okay if you are working on your own project, but less than ideal if you are working on an open source project, or on a team.

This post will talk about options you can add to globally ignore VS Code settings files from all of you Git projects.

Configure an excludesfile in your .gitconfig file.

On Mac, you should be able to fine a .gitconfig file in your user’s home directory. You can edit the file to add the following. The path found here will define the file location to a global ignore file.

[core]
  excludesfile = /Users/andy/.gitignore_global

Add VSCode settings files to the global ignore file

Once you have Git configured to look for a global exclude file, you can add the .vscode/ directory to the file. This is the pathing that VS Code uses when storing workspace specific settings.

.vscode/

And that’s it! You won’t have Git constantly tracking your .vscode directory anymore.

Feel free to comment below if I’ve left anything out of or if you have anything questions.

Leave a Reply

Your email address will not be published.