I have a global gitignore file defined in my gitconfig but Visual Studio Code seems to not be interpreting it. How would I use a global gitignore with Visual Studio Code?
EDIT: Comment from Piyush Soni.
As of 9 august 2021, for this configuration to work, you also have to check useIgnoreFiles
, hence:
"search.useGlobalIgnoreFiles": true,
"search.useIgnoreFiles": true
You have to add these in your settings to allow global gitignore:
"search.useGlobalIgnoreFiles": true
Found on Microsoft/vscode#59364.
For this to work, I also had to restart my VSCode session.
Note that you must already have a global ignore file if you want it to be useful. You can set or see which one is set with the next commands:
# get
git config --global core.excludesFile
# set
git config --global core.excludesFile <filename>
See more details about gitignore on the git documentation.
This steps to Windows:
Done! 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With