Skip to content

GitHubDesktop 3.4.9 Hook Script System Variable Issue Remains Unsolved  #19652

@zhihaolai

Description

@zhihaolai

The problem

When attempting to commit using this version, I encountered the error: .git/hooks/pre-commit: line 29: python: command not found.
I am certain that my python environment is properly configured. After printing the $PATH, I found that the path format was non-Windows, with some parts like:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Users/ts/AppData/Local/GitHubDesktop/app-3.4.9/resources/app/git/mingw64/libexec/git-core:/mnt/c/

I browsed related issues on Github (such as local hooks stopped working after updating to latest verison. #18739 and Use dugite system config #563) and tried the proposed solutions, but the problem remains unresolved.

Ultimately, I was able to solve the issue by disabling the Windows Subsystem for Linux.

However, I sometimes need to use the Windows Subsystem for Linux, so I hope a better solution can be found that allows me to use both GitHubDesktop and the subsystem without encountering this problem.

Release version

Version 3.4.9 (x64)

Operating system

Windows11

Steps to reproduce the behavior

No response

Log files

echo $PATH when error:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Users/ts/AppData/Local/GitHubDesktop/app-3.4.9/resources/app/git/mingw64/libexec/git-core:/mnt/c/Users/ts/AppData/Local/GitHubDesktop/app-3.4.9/resources/app/git/mingw64/bin:/mnt/c/Users/ts/AppData/Local/GitHubDesktop/app-3.4.9/resources/app/git/usr/bin:/mnt/c/Users/ts/bin:/mnt/c/Users/ts/AppData/Local/GitHubDesktop/app-3.4.9/resources/app/git/mingw64/bin:/mnt/c/Users/ts/AppData/Local/GitHubDesktop/app-3.4.9/resources/app/git/mingw64/usr/bin:/mnt/c/Program Files/YunShu/utils:/mnt/c/Program Files/Common Files/Oracle/Java/javapath:/mnt/d/Program Files/ImageMagick-7.1.1-Q16-HDRI:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/Microsoft SQL Server/150/Tools/Binn/:/mnt/d/Program Files/CMake/bin:/mnt/d/Program Files/7-Zip:/mnt/c/Users/ts/AppData/Local/Programs/Python/Python38:/mnt/c/Program Files/dotnet/:/mnt/g/platform-tools:/mnt/d/Program Files/gnuplot/bin:/mnt/d/Program Files/:/mnt/d/Program Files/TortoiseGit/bin:/mnt/c/Program Files (x86)/NetSarang/Xftp 7/:/mnt/d/Program Files/Git/cmd:/mnt/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit/:/mnt/c/Users/ts/AppData/Local/Microsoft/WindowsApps:/mnt/d/Users/ts/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/ts/AppData/Local/Programs/Python/Python38/Scripts:/mnt/g/Fever System/fastboot:/mnt/d/Program Files/JetBrains/PyCharm Community Edition 2023.2/bin:/mnt/f/StudyProjet/LumixEngine/projects:/mnt/c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/Llvm/x64/bin11:/mnt/d/Program Files/git-filter-repo:/mnt/c/Users/ts/.dotnet/tools:/mnt/c/Users/ts/AppData/Local/GitHubDesktop/bin
Python 执行失败,错误信息:
.git/hooks/pre-commit: line 29: python: command not found

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigation-neededLikely bugs, but haven't been reliably reproduced by a reviewer

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions