Skip to content

Failed to push #21601

@TheBlubb14

Description

@TheBlubb14

The problem

Running pre-push hook...
error: failed to push some refs to 'https://github.com/mycompany/myproject
.git'

It seems that the new hooks feature currently in beta has some issues.
I cannot push to my remote with GitHub Desktop.

Additionally trying to disable Load Git hook environment variables from shell in the options is not saved.
Unchecking the checkbox and clicking save, will not save it.

Content of the file `.git/pre-push`
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { printf >&2 "\n%s\n\n" "This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'pre-push' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."; exit 2; }
git lfs pre-push "$@"

Release version

Version 3.5.5-beta4 (x64)

Operating system

Windows 11 25H2

Steps to reproduce the behavior

No response

Log files

2026-02-11T17:50:20.856Z - error: [ui] hooks proxy failed:
Error: could not find environment variables in shell output
at Socket. (C:\Users\me\AppData\Local\GitHubDesktop\app-3.5.5-beta4\webpack:\app\src\lib\hooks\get-shell-env.ts:58:13)
at Socket.emit (node:events:520:35)
at endReadableNT (node:internal/streams/readable:1701:12)
at processTicksAndRejections (node:internal/process/task_queues:89:21)
2026-02-11T17:50:20.866Z - info: [ui] Executing push: git push origin mybranch:mybranch --progress (took 1.177s)
2026-02-11T17:50:20.867Z - error: [ui] git push origin mybranch:mybranch --progress exited with an unexpected code: 1.
Running pre-push hook...
error: failed to push some refs to 'https://github.com/mycompany/myproject.git'

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugConfirmed bugs or reports that are very likely to be bugspriority-2Bug that affects more than a few users in a meaningful way but doesn't prevent core functions

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