Repository navigation
Description
The problem
When pushing from GitHub Desktop on Windows, a repository with a pre-push hook can fail before the hook body runs:
Running pre-push hook...
fatal: could not open '/dev/stdin' for reading: No such file or directory
pre-push hook failed with code 128
This appears to come from Desktop's hook proxy passing a Unix-style pseudo-path to git hook run:
...(hasStdin ? ['--to-stdin=/dev/stdin'] : []),git hook run --to-stdin=<path> expects a file path. On this Windows setup, both Git for Windows and GitHub Desktop's bundled Git fail when that path is /dev/stdin, before the repository hook itself can run.
Release version
GitHub Desktop 3.6.3
Operating system
Microsoft Windows 11 Pro 10.0.26200, build 26200
Steps to reproduce the behavior
- Use GitHub Desktop on Windows.
- Open a repository with
core.hooksPathconfigured and apre-pushhook. - Push from GitHub Desktop.
- Observe the pre-push failure above.
The repository hook involved in my case does not contain /dev/stdin. It is a normal tracked pre-push hook that eventually delegates to git lfs pre-push "$@".
Expected behavior
GitHub Desktop should pass hook stdin to git hook run using a Windows-compatible mechanism.
Since git hook run --to-stdin=<path> expects a file path, one possible implementation would be for Desktop to materialize the incoming hook stdin stream into a per-invocation temporary file and pass that real file path to --to-stdin, instead of passing /dev/stdin.
Actual behavior
Desktop passes --to-stdin=/dev/stdin. Git for Windows cannot open that path in this invocation path, so the hook fails before the hook script body runs.
Log files
Relevant excerpt from 2026-07-24.desktop.production.log:
2026-07-24T00:04:24.789Z - info: [ui] Executing push: git push origin logan/obsidian:logan/obsidian --progress (took 8.940s)
2026-07-24T00:04:24.793Z - error: [ui] `git push origin logan/obsidian:logan/obsidian --progress` exited with an unexpected code: 1.
Running pre-push hook...
fatal: could not open '/dev/stdin' for reading: No such file or directory
pre-push hook failed with code 128 after 0.23s
error: failed to push some refs to 'https://github.com/LAF-US/IDAHO-VAULT.git'
Additional diagnostics
Versions on the affected machine:
Git for Windows: git version 2.49.0.windows.1
GitHub Desktop bundled Git: git version 2.53.0.windows.3
Git LFS: git-lfs/3.6.1 (GitHub; windows amd64; go 1.23.3; git ea47a34b)
Direct reproduction with user Git for Windows:
git hook run --to-stdin=/dev/stdin pre-push -- origin https://github.com/OWNER/REPO.gitfails with:
fatal: could not open '/dev/stdin' for reading: No such file or directory
Using a real file path succeeds:
git hook run --to-stdin=.githooks/stub.txt pre-push -- origin https://github.com/OWNER/REPO.gitThe same pass/fail behavior occurs with GitHub Desktop's bundled Git.
Inside Git Bash, /dev/stdin exists as a pseudo-path, but git hook run --to-stdin=/dev/stdin ... still fails after resolving to /proc/self/fd/0.
I also checked the current release-3.6.4-beta1 source, and it still appears to contain the same --to-stdin=/dev/stdin line:
Provenance
This report is filed by Logan Finney, a GitHub Desktop user. The original failure was encountered manually while pushing from the GitHub Desktop GUI. I used an AI coding assistant, OpenAI Codex, to help inspect GitHub Desktop logs/source and run the local reproduction commands above; I cross-checked the findings before filing this issue.
Activity
desktop-triage commentedon Jul 28, 2026
Labeling this as
bug+windows+priority-2: the issue clearly identifies thathooks-proxy.tspasses--to-stdin=/dev/stdintogit hook run, which fails on Windows because/dev/stdinis not a valid file path there — confirmed with a direct reproduction command and logs. No duplicate was found; the suggested fix (materializing stdin into a temp file on Windows) is a reasonable direction for engineering to evaluate.Mustafa-shikalgar commentedon Aug 1, 2026
Hi! I'd like to work on this issue if it's available. I'll investigate the Windows hook proxy behavior and prepare a fix.
Tweak some colors for shell languages
500gt commentedon Oct 6, 2026
#22956