0

Git is not tracking .vscode folder?

I created a new project and added some files, folders. one of them is .vscode for keeping project related settings and extensions. I don't know why it is not being tracked by git. I haven't put .vscode in gitignore.

  • try to delete `.gitignore` and see if that helps – rioV8 Feb 16 '21 at 16:04
  • to check what is ignored, and what file contains the ignore pattern : `git check-ignore -v .vscode` – LeGEC Feb 16 '21 at 16:17
  • @rioV8 I can't delete .gitignore as I need to ignore some paths – Deepak Bharti Feb 16 '21 at 16:37
  • Okay, so the issue is fixed. Actually I had a kinda global gitignore in `/Users/dbadsmac` dbadsmac is my username on mac. I had .vscode set there. So removing it from there fixed the issye. Thanks @LeGEC for letting me know of this command. – Deepak Bharti Feb 16 '21 at 16:58
  • Only temporary rename/delete to see if that solves the tracking issue, if so the content of `.gitignore` is relevant – rioV8 Feb 18 '21 at 13:44

1 Answers1

0

There is a global kind of .gitignore in users directory, in mac it is /Users/<username>/.gitignore all the paths in this file will always be ignored in all the git repositories irrespective of them being in the .gitignore of related directory.

So, either remove .vscode from this gloabal .gitignore or maybe just delete this .gitignore to avoid anything like this. It literally took lot of my time. I searched a lot on google but all I was getting was completely opposite to my problem.