Skip to content

GitLens is creating stray .git folders in sub-folders of my repository #5080

@Ten0

Description

@Ten0

Description

GitLens appears to be creating stray .git folders in sub-folders of my repository.
This appears to be caused by changes recently performed in #4968.
This is causing issues for tools that detect "repository root" as the closest folder in the path to have a .git folder, that now mis-detect the repository root.
I never asked to have these extra .git folders, and I don't want them here.

How to reproduce:

  1. Create a git repository
  2. Open a sub-folder of the repository with GitLens and use it for a bit
  3. See how that creates a stray .git folder in that sub-folder

GitLens Version

17.11.1

VS Code Version

Version: 2.6.19
VSCode Version: 1.105.1
Commit: 224838f96445be37e3db643a163a817c15b36060
Date: 2026-03-12T04:07:27.435Z
Build Type: Stable
Release Track: Default
Electron: 39.4.0
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Linux x64 6.12.76

Git Version

git version 2.51.2

Logs, Screenshots, Screen Captures, etc

> tree .git
.git
└── gk
    └── config
> cat .git/gk/config
[branch "master"]
	gk-last-accessed = 2026-03-17T14:58:21.580Z
	gk-last-modified = 2026-03-17T14:58:21.580Z

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions