0

Every time I open a new folder from my files, Source Control thinks it's a repository. For example:

https://i.stack.imgur.com/fs4Ir.png

These are all files I've created in VS Code, but it considers them "untracked"

VarMaster
  • 1
  • 1
  • There's probably a .git folder somewhere in your folder hierarchy, even in your ancestors. VS Code will look for a .git folder, or look inside the parent folder, and so on, up to the root – Steve B Jul 20 '22 at 18:31
  • I looked in my whole computer, and there's not one .git file – VarMaster Jul 20 '22 at 18:38
  • 1
    this is an hidden file, maybe an option in your system ? If you want to find this root, you can execute [`git rev-parse --show-toplevel`](https://stackoverflow.com/a/957978/588868) – Steve B Jul 20 '22 at 18:50
  • It's ok I removed the .git file hidden in my Desktop. Everything seems to be working fine now. Thanks for the the help! – VarMaster Jul 20 '22 at 19:03

1 Answers1

0

If VS Code shows the source control tab, it's because it found a .git folder either in the folder you opened or any of the ancestor. It will looks for such folder recursively, up to the root.

This folder contains all the local git database stuff.

You should look inside your folder structure up to find such folder and remove it (it's probably an hidden folder, you should set your options accordingly).

Another way to find where's this folder is located is to open a command prompt, cd your folder and run git rev-parse --show-toplevel. This will output the repo root folder.

Steve B
  • 36,818
  • 21
  • 101
  • 174