0

I have the same problem as this one but I'm on Windows. I searched everywhere to fint a .git (not only in Windows) but nothing. Not even in projects where I did git init (via the terminal of VS code). I suppose that's why I get this error. Because all the projects where I use git, use the same .git file that is somewhere...

When I run (in a project) git rev-parse --show-toplevel to find out where my git repository root is, I get C:/Users/username. Which is of course wrong! But in there (as you see in pic) there is no .git file. Should I delete gitconfig?Where is .git

  1. How can I find the .git that creates the problem?
  2. Why my projects that I've used git init don't have a .git file?

5k changes

Fotios Tsakiris
  • 1,310
  • 1
  • 18
  • 24

1 Answers1

1

Go to Control Panel -> File Explorer Options

Select the "View" Tab

Select the following options:

  • Check: Show Hidden files, folders and drives
  • Uncheck: Hide extensions for known file types
  • Check: Show drive letters
  • Check: Show encrypted or compressed NTFS files in colour
  • Check: Navigation Pane/ Expand to open folder
  • Check: Navigation Pane/ Show all folders

You should now see the .git folder, and delete or rename it.

Ben
  • 34,935
  • 6
  • 74
  • 113
  • Thank you. I deleted the file. Then i went back to my project and initialized again a git repository. I got a `.git` file in my project... all good. But I still get the 5k changes (see 2nd pic above). – Fotios Tsakiris Jan 23 '19 at 12:14
  • @FotisTsakiris In VSCode, just open the folder you want not the Users/free-do folder. File->Open folder... … Also it sounds like you have again initialised the git repository in the wrong place. – Ben Jan 23 '19 at 12:35
  • It's OK. I tried to to initialize a git repo in a **new** project and it works. Thanks a lot. – Fotios Tsakiris Jan 23 '19 at 13:53