Gitignore Visual Studio Code



It depends whether you want to share the settings inside the.vscode folder. On our team, we don't put.vscode into the.gitignore file because we want to share our team's recommended settings, launch configurations, tasks and extensions between developers. If you have machine specific settings then that won't work so well. # Created by # Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode. .gitignore for Visual Studio Projects and Solutions, See the official GitHub's 'Collection of useful.gitignore templates'. The.gitignore for Visual Studio can be found here: gitignore extension for Visual Studio Code. A extension for Visual Studio Code that assists you in working with.gitignore.

Add a global .gitignore

Gitignore Visual Studio Code
  1. Open the Terminal
  2. Run touch ~/.gitignore_global to create a global .gitignore file in the home directory
  3. Run open ~/.gitignore_global
  4. Add .vscode/ and any other files or directories that you want to ignore and not include in project-specific .gitignore files (don’t forget to save!)
  5. Run git config --global core.excludesfile ~/.gitignore_global
Visual studio code git configurationVisual

That’s it! Using .gitignore_global will let you customize your editor without having to edit and commit changes to the .gitignore file for every single project.

Visual

Editor Specific Example

Visual Studio Code (and other editors) have the ability to make customizations to fit your needs; especially through extensions. I recently started using the Peacock extension to quickly distinguish between multiple VS Code instances that I may have open at one time. You can customize Peacock to change the color of your Activity Bar, Status Bar and/or the Title Bar.


Install Git On Visual Studio Code

This will create a settings.json inside of a .vscode folder. While this is applicable to your local editor, it may not be appropriate to commit to the repository (after all, your teammates may be using Atom, Sublime or Vim). Instead of adding these editor specific files to .gitignore for every project, you can create a global .gitignore.

Add Gitignore Visual Studio

Resources