You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Experimental hooks support is currently released to beta. This issue is tracking the work needed to ship hooks support to production.
Background
GitHub Desktop has long struggled with Git hooks. Because Desktop ships with its own embedded Git installation (especially on Windows), hooks often fail when they depend on the user's shell environment, version managers, or tools not present in Desktop's stripped-down Git. Additionally, Desktop previously had no way to distinguish between a hook rejection and other Git failures, and terminal escape codes in hook output would render as garbled text.
This work introduces optional hook interception that addresses these issues by running hooks in the user's configured shell environment.
What's in beta
Shell environment execution: Hooks run in the user's configured shell (zsh, bash, Git Bash,
PowerShell), inheriting environment variables from login scripts
Hook bypass support: Users can preemptively skip commit hooks or bypass a failed hook after the fact
without aborting
Live hook output: Desktop shows hook output in real-time as it runs
Terminal rendering: Integrated xterm.js to properly render colors and escape codes
I have a couple of questions:
• How does Desktop detect the user's default shell across different operating systems?
• What happens if the configured shell fails to execute the hook?
• Are there any fall backs to the embedded Git environment?
• How does Desktop detect the user's default shell across different operating systems?
Short answer is it doesn't, for macOS it'll use the SHELL environment variable falling back to /bin/bash, for Windows it'll default to Git Bash if Git for Windows is installed.
• What happens if the configured shell fails to execute the hook?
GitHub Desktop will pop a dialog showing the output and exit code from the hook and the user gets to decide whether to ignore the hook error or abort the commit.
• Are there any fall backs to the embedded Git environment?
In so far that the user can decide to not load environment variables from their shell, yes. This is still the default for production.
Activity
[-]Hooks tracking issue[/-][+]Git hooks support[/+]sindhu838 commentedon Mar 9, 2026
Thanks for the detailed explanation.
I have a couple of questions:
• How does Desktop detect the user's default shell across different operating systems?
• What happens if the configured shell fails to execute the hook?
• Are there any fall backs to the embedded Git environment?
niik commentedon Mar 9, 2026
Short answer is it doesn't, for macOS it'll use the SHELL environment variable falling back to
/bin/bash, for Windows it'll default to Git Bash if Git for Windows is installed.GitHub Desktop will pop a dialog showing the output and exit code from the hook and the user gets to decide whether to ignore the hook error or abort the commit.
In so far that the user can decide to not load environment variables from their shell, yes. This is still the default for production.
niik commentedon Mar 9, 2026
Gonna close this issue as it shipped in 3.5.5!
sindhu838 commentedon Mar 9, 2026
sindhu838 commentedon Mar 11, 2026