[Bug] Windows: Git 2.48.1 被判定为低于 2.31,提示 "Git 2.31 or newer is required",仓库无法读取
Maintainers usually reply within 1 day
@AACS111 is already working on this.
Since Oct 29, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Start with rust/lithe-core/src/git/execution_policy.rs and inspect validate_version; then trace how lithe_git_host::configuration::version() obtains and caches Git's version on Windows. The report suspects empty probe output but has not verified the cause, so first reproduce with the provided Git 2.48.1 setup and inspect the probe result. Done means Git is recognized and the error distinguishes an empty or unparseable probe from an outdated version.
Written by the indexing model from the issue text.
Description
Platform / 平台
Windows
Area / 模块
Git
Lithe version / Lithe 版本
0.6.5
Priority / 优先级
P1 / 尽快处理:使用体验大幅下降,但通常仍可继续使用
OS and architecture / 操作系统与架构
Windows 11 10.0.26200, AMD64
Environment / 环境信息
Git for Windows 2.48.1.windows.1(安装在 D:\Program Files\Git,非 C 盘)
命令行 git --version 正常:git version 2.48.1.windows.1
Steps to reproduce / 复现步骤
- 用 Lithe 打开含 Git 仓库的项目
- 提交面板提示“Git 无法读取此仓库”
- 设置 → 版本控制 → Git:把“Git 可执行文件”分别设为 bin\git.exe、cmd\git.exe;配置来源试过“当前仓库”和“全局 Git 配置”;保存、点“重新读取 Git 配置”、完全重启 IDE
- 报错不变
Expected behavior / 预期行为
识别到 Git 2.48.1,仓库正常读取。
Actual behavior / 实际行为
Git 2.31 or newer is required; select a newer executable in Git settings
命令行 git --version、git status 均正常(cmd\git.exe、mingw64\bin\git.exe、bin\git.exe 三个都输出 2.48.1)。
日志 %LOCALAPPDATA%\app.lithe.windows\logs\git\ 中全是 error_code=invalid_request,duration_ms 多为 0~1,没有具体原因。
初步分析(读源码所得,未能编译验证):报错来自 rust/lithe-core/src/git/execution_policy.rs 的 validate_version。解析逻辑本身没问题(带 .windows.1 后缀有单测覆盖),推测 lithe_git_host::configuration::version() 取到了空输出,被报成“版本过低”。该函数会缓存探测结果,空串也会被缓存;子进程以 CREATE_SUSPENDED + Job Object、stdin=NUL 启动,可能与本机磁盘加密驱动相互影响。建议:探测输出为空或无法解析时,错误信息带上原始输出和 exit code,并与“版本过低”区分;不缓存空结果。
Logs or diagnostic output / 日志或诊断输出
[scope=git.executionInspect] operation finished category=git error_code=invalid_request duration_ms=0
[scope=git.repositorySetup] operation finished category=git error_code=invalid_request duration_ms=1
Screenshots or recordings / 截图或录屏
Checklist / 提交前检查
- I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复报告。
- I removed secrets and personal data from the report. / 我已从报告中移除敏感信息和个人数据。
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 151
- Avg merge
- 11h 43m
- Merged PRs (30d)
- 345
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from 1lck/Lithe-IDEA
-
area:editor bug P0 platform:macos review: low
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
1lck/Lithe-IDEA#1118 · 2 comments ·
Maintainers usually reply within 1 day
-
area:editor enhancement issue-form:feature P0 platform:macos review: medium
Difficulty 5/5 Over a week Newbie friendliness 20/100
1lck/Lithe-IDEA#1584 ·
Maintainers usually reply within 1 day
-
[Bug] 全局搜索逻辑匹配问题Possibly taken @arkleselect claimed this 1 day ago. Openarea:editor bug issue-form:bug P0 platform:macos review: medium
1lck/Lithe-IDEA#1564 · 1 assignee ·
Maintainers usually reply within 1 day
-
area:run bug P1 platform:windows review: low
Difficulty 4/5 3-5 days Newbie friendliness 55/100
1lck/Lithe-IDEA#1562 ·
Maintainers usually reply within 1 day
-
[Feature] 功能建议Possibly taken @frankxii claimed this today. Openarea:editor claimed enhancement issue-form:feature P1 platform:windows review: low
Difficulty 3/5 1-2 days Newbie friendliness 55/100
1lck/Lithe-IDEA#1560 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
CopilotKit/openmuse#215 ·
Maintainers usually reply within 3 days
-
b:minor bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
software-mansion/argent#1698 ·
Maintainers usually reply within 1 day
-
e2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
redhat-developer/rhdh-plugin-export-overlays#4624 · 1 comment ·
Maintainers usually reply within 1 day