Skip to content

Should use git for windows on windows hosts (and probably allow advanced config to override git.exe location) #12431

Closed

Description

@fluffynuts

Describe the bug

GitHub Desktop bundles git cli tools for doing all the heavy lifting - which is great for users, but doesn't appear to run the same as portable git for windows and that means that it's not running as expected with git hooks:

this is the process tree spawned by git push when using portable git (and what I get from running git from scoop, since that's installing portable git from https://git-scm.com/download/win:
git-process-tree-portable-git

Now this is the process tree when git is run from GitHub Desktop:
git-process-tree-github-desktop-bundled

And the problem (probably) is that intermediate conhost.exe (I guess, probably set up to run within a MING environment).

I believe that GitHub Desktop should be using Portable Git on Windows (and it would also be very nice if there were a UI setting to change which git.exe to use, for exactly issues like this)

Behavior is described below.

Version & OS

OS: Windows 10
GitHubDesktop: 2.8.3 (x64)

Steps to reproduce the behavior

  1. Create a new Node project (npm init -y)
  2. Install the pre-git package, which sets up hooks (this is just the easiest way to see the problem, but I'm sure manual hooks will have the same issues)
  3. Attempt to commit via GitHub desktop
  4. See error:
./node_modules/.bin/pre-commit: line 5: cygpath: command not found
sh: /../pre-git/bin/pre-commit: No such file or directory

(this stems from the pre-git script thinking it's in an MSYS environment, but missing the cygpath tool)

Expected behavior

I expect git commands to work as expected. Now, one could argue that the problem stems from lines like this in the installed pre-git hooks (now offloaded into the package's code under node_modules):

case `uname` in
    *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac

but the issue here would then be that if git is running in a matching environment, it should have the expected cypath utility, or something equivalent. The problem could be resolved by simply using the official portable binaries for git.

Actual behavior

No git operations work with pre-git installed (same would happen for any other tool attempting to run properly under an MSYS/CYGWIN environment)

Screenshots

image

Logs

2021-06-11.desktop.production.log

Activity

  1. added
    windows
    on Jun 25, 2021
  2. tidy-dev commented on Jul 14, 2026

    @tidy-dev
    Contributor

    See comment #17801 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    windows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions