Skip to content

VSCode loops 'not a git repo' message in non-Git projects #246608

Open
@Vargock

Description

@Vargock

Type: Bug

Problem
When opening files in any non-Git workspace, the VSCode Output panel repeatedly logs the following Git error:

> git rev-parse --show-toplevel
fatal: not a git repository (or any of the parent directories): .git

This occurs even when the workspace has never been initialized with Git.

Expected behavior
I expect VSCode (or the responsible extension) to detect the absence of a Git repository and stop attempting Git operations, rather than continuously logging errors in the Output panel.

Steps to Reproduce

  1. Open VSCode.
  2. Open any workspace that is not part of a Git repository.
  3. Open a file or interact with the workspace normally.
  4. Check the Output panel → observe repeated git rev-parse calls and corresponding errors.

VS Code version: Code 1.99.2 (4949701, 2025-04-10T01:21:25.295Z)
OS version: Windows_NT x64 10.0.26100
Modes:

System Info
Item Value
CPUs AMD Ryzen 5 5600X 6-Core Processor (12 x 3700)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 23.95GB (12.62GB free)
Process Argv --crash-reporter-id b26a7cdf-055d-4c9a-a6c9-84f96e346fe7
Screen Reader no
VM 0%
Extensions: none
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30959799
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dwnewjupyter:31046869
pythonrstrctxt:31112756
nativeloc1:31192215
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
9064b325:31222308
copilot_t_ci:31222730
e5gg6876:31282496
pythoneinst12:31285622
bgtreat:31268568
4gafe986:31271826
31787653:31262186
3e8i5726:31271747
996jf627:31283433
usemplatestapi:31285209
7bj51361:31283001
747dc170:31275177
g20af354:31278749
aj953862:31281341

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions