0

I'm working with 2 different projects in VScode, and I'm using the global .gitignore file to ignore both types of files. Here is my global .gitignore file:

# Settings.
.vscode
.vscode/
.vscode*
/.vscode
.vscode/settings.json
.vscode//settings.json
.vscode//settings.json*

# Linters.
.babelrc
.jscsrc
.jsbeautifyrc
.jshintrc
.eslintignore
.eslintrc.json
.eslintrc.json*
.eslintrc*
.stylelintrc

Of course I already set the excludesFile to the file's path:

core.excludesfile=C:\Users\or.as\.gitignore

But for some reason, the git ignores only the eslint file, and not on the .vscode/settings.json file. Any idea what can cause this?
Thanks!

Or Assayag
  • 5,662
  • 13
  • 57
  • 93
  • Why are you excluding the linter configuration? _"We all have to use the same style, but I'm not going to tell you what it is."_ – jonrsharpe Aug 21 '21 at 08:18
  • @jonrsharpe We have global eslint and in my local environment I just don't want to see errors in my IDE. – Or Assayag Aug 21 '21 at 08:23
  • This .gitignore works fine for me, are you sure that paths of your vscode folder are correct? – LeonFibuck Aug 21 '21 at 11:05
  • In what way Git doesn't ignore `.vscode/settings.json`? Please show us the text output of `git status` — is the file modified? In that case the file is tracked and cannot be ignore — `.gitignore` doesn't ignore tracked files. To ignore it you should [untrack the file (remove it from the repo)](https://stackoverflow.com/a/1274447/7976758). – phd Aug 21 '21 at 12:23

0 Answers0