desktop icon indicating copy to clipboard operation
desktop copied to clipboard

未能自动将Git可执行文件路径注册到Path环境变量中

Open ankium opened this issue 2 months ago • 2 comments

The problem

安装最新版的GitHub Desktop v3.6.5后,我本打算在命令提示符窗口或者Windows Powershell窗口中使用Git命令,但是提示Git命令不存在,并且在GitHub Desktop的Repository菜单下点击“Open in Powershell”时提示“Unable to locate Git”!

Release version

3.6.5

Operating system

Windows 10 22H2

Steps to reproduce the behavior

No response

Log files

No response

Screenshots

Image Image

Additional context

需要手动将以下路径注册到Path环境变量中 C:\Users\Ankium\AppData\Local\GitHubDesktop\app-3.6.5\resources\app\git\cmd

Image Image

Suggestions

在Github Desktop软件安装后自动将Git执行路径注册到Path环境变量中!

ankium avatar Sep 06 '26 04:09 ankium

This issue may have been opened accidentally. I'm going to close it now, but feel free to open a new issue with a more descriptive title.

github-actions[bot] avatar Sep 06 '26 04:09 github-actions[bot]

Classification: Support Question (expected behavior)

This report describes GitHub Desktop's bundled Git not being available from an external Command Prompt/PowerShell window, and "Open in PowerShell" failing with "Unable to locate Git" for a fresh 3.6.5 install on Windows 10 22H2. No reproduction steps or logs were provided beyond screenshots, but the core claim (bundled git not on system PATH) is verifiable as intentional design rather than a defect: GitHub Desktop ships its own embedded copy of Git under resources/app/git for internal use by the app, and it does not add this path to the user's global PATH environment variable — that would risk conflicting with a separately installed Git for Windows. Related discussions (#17801, #12431) cover the same architectural decision to keep the bundled Git isolated rather than exposing it system-wide.

Initial hypothesis: The "Unable to locate Git" message from "Open in PowerShell" is a known limitation of this same design — the external shell integration relies on Git being discoverable either via the system PATH or a resolvable installation, and GitHub Desktop deliberately does not register its embedded Git in PATH at install time. The fix suggested by the reporter (manually adding ...\app-3.6.5\resources\app\git\cmd to PATH) is a reasonable workaround but not something the app does automatically by design, so this looks like expected behavior rather than a regression.

No duplicate label is available in this repo, but for reference this overlaps in root cause with #17801 ("GitHub Desktop does not use some paths from the Git for Windows installation") and #12431, both closed, which discuss the same bundled-vs-system-Git architecture. The invalid/needs-triage labels already applied by automation align with treating this as expected behavior rather than a bug; no additional labels are suggested. If the reporter believes external shell PATH integration should be automatic, that would be better framed as a separate enhancement request.

Generated by Issue Triage (skills-driven) for #22821 · auto · 20.6 AIC · ⌖ 1.4 AIC · ⊞ 9.3K · ◷

desktop-triage[bot] avatar Sep 06 '26 04:09 desktop-triage[bot]