To display hidden .git directories in Visual Studio Code, do the following:
On Windows or Linux, select File → Preferences → Settings.
On Mac, select Code → Preferences → Settings.
In Visual Studio Code settings (Settings Editor), select Editor → File and scroll to (or search for) Exclude. Comment out the glob to exclude .git files (// **/.git). See the attached screenshot: VS Code glob commenting.
Also see Visual Studio Code User and Workspace Settings. You will find the default settings on the page, which you could edit, but I chose to comment the glob out to conveniently hide these files later should I so desire.
Visual Studio Code: Show hidden folders contains more information on the subject.