Repository navigation
Open
Labels
investigation-neededLikely bugs, but haven't been reliably reproduced by a reviewer
Description
The problem
Since 3.2.2 or 3.2.3 I observe a regression, namely that squashing commits, or in general rebasing, takes very long in the presence of a post-checkout bash script hook. There is some sort of timeout going on where you have to wait for pretty much exactly 30 seconds.
Release version
3.2.3 (x64)
Operating system
Windows 10
Steps to reproduce the behavior
- Assume a linear git history.
- Create a file
./.git/hooks/post-checkoutwith the contents#!/bin/bash(nothing else) - Drag the latest commit over the second latest commit (to initiate a squash).
- Click "Squash 2 commits"
Observe that the "Squash in progress" dialog takes 30 seconds.
Log files
Details
2023-05-11T13:31:15.125Z - info: [main] Using toast activator CLSID {27D44D0C-A542-5B90-BCDB-AC3126048BA2}
2023-05-11T13:31:15.393Z - info: [ui] [AppStore] loading 24 repositories from store
2023-05-11T13:31:15.394Z - info: [ui] [AppStore] found account: JeroenBos (Jeroen Bos)
2023-05-11T13:31:15.408Z - info: [ui] [BranchPruner] Last prune took place 3 hours ago - skipping
2023-05-11T13:31:15.817Z - warn: [ui] Error refreshing account 'JeroenBos'
Error: Cannot update an account which doesn't have a token: JeroenBos
at it (C:\Users\Windows\AppData\Local\GitHubDesktop\app-3.2.3\webpack:\app\src\lib\fatal-error.ts:3:9)
at C:\Users\Windows\AppData\Local\GitHubDesktop\app-3.2.3\webpack:\app\src\lib\stores\accounts-store.ts:214:12
at ir.tryUpdateAccount (C:\Users\Windows\AppData\Local\GitHubDesktop\app-3.2.3\webpack:\app\src\lib\stores\accounts-store.ts:134:20)
at C:\Users\Windows\AppData\Local\GitHubDesktop\app-3.2.3\webpack:\app\src\lib\stores\accounts-store.ts:114:37
at Array.map (<anonymous>)
at ir.refresh (C:\Users\Windows\AppData\Local\GitHubDesktop\app-3.2.3\webpack:\app\src\lib\stores\accounts-store.ts:114:21)
at ir.loadInitialState (C:\Users\Windows\AppData\Local\GitHubDesktop\app-3.2.3\webpack:\app\src\lib\stores\app-store.ts:2110:24)
2023-05-11T13:31:15.879Z - warn: [ui] fetchAll: 'repos/JeroenBos/JBNA/issues?state=open' returned a 404
2023-05-11T13:31:15.890Z - info: [ui] [fetchProtectedBranches] unable to list protected branches
Error: Not Found
at Bt (C:\Users\Windows\AppData\Local\GitHubDesktop\app-3.2.3\webpack:\app\src\lib\http.ts:178:11)
at En.fetchProtectedBranches (C:\Users\Windows\AppData\Local\GitHubDesktop\app-3.2.3\webpack:\app\src\lib\api.ts:1548:7)
at ir.updateBranchProtectionsFromAPI (C:\Users\Windows\AppData\Local\GitHubDesktop\app-3.2.3\webpack:\app\src\lib\stores\app-store.ts:3962:11)
2023-05-11T13:31:15.912Z - info: [ui] launching: 3.2.3 (Windows 10.0.19044)
2023-05-11T13:31:15.920Z - info: [ui] execPath: 'C:\Users\Windows\AppData\Local\GitHubDesktop\app-3.2.3\GitHubDesktop.exe'
2023-05-11T13:31:16.011Z - warn: [ui] Alive channel request failed: Error: Not Found
2023-05-11T13:31:16.042Z - warn: [ui] fetchRepository: 'JeroenBos/JBNA' returned a 404
2023-05-11T13:31:16.066Z - warn: [ui] Alive channel request failed: Error: Not Found
2023-05-11T13:31:16.078Z - warn: [ui] fetchAll: 'repos/JeroenBos/JBNA/pulls?state=open' returned a 404
2023-05-11T13:31:16.090Z - warn: [ui] Alive channel request failed: Error: Not Found
2023-05-11T13:31:16.118Z - warn: [ui] Alive channel request failed: Error: Not Found
2023-05-11T13:31:20.437Z - info: [ui] [Timing] Action 'create commit' for 'JeroenBos/JBNA' took 0.001s
2023-05-11T13:31:20.693Z - info: [ui] [squash] starting rebase for format at e46e133de43ab86759506eec3b3ff635e5c24ef0
2023-05-11T13:31:20.694Z - info: [ui] [squash] to restore the previous state if this completed rebase is unsatisfactory:
2023-05-11T13:31:20.694Z - info: [ui] [squash] - git checkout format
2023-05-11T13:31:20.694Z - info: [ui] [squash] - git reset e46e133de43ab86759506eec3b3ff635e5c24ef0 --hard
2023-05-11T13:31:22.833Z - error: [ui] `git -c credential.helper= fetch --progress --prune --recurse-submodules=on-demand origin` exited with an unexpected code: 128.
stderr:
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
(The error was parsed as 2: Authentication failed. Some common reasons include:
- You are not logged in to your account: see File > Options.
- You may need to log out and log back in to refresh your token.
- You do not have permission to access this repository.
- The repository is archived on GitHub. Check the repository settings to confirm you are still permitted to push commits.
- If you use SSH authentication, check that your key is added to the ssh-agent and associated with your account.
- If you use SSH authentication, ensure the host key verification passes for your repository hosting service.
- If you used username / password authentication, you might need to use a Personal Access Token instead of your account password. Check the documentation of your repository hosting service.)
2023-05-11T13:31:23.854Z - info: [ui] [fetchPushControl] unable to check if branch is potentially pushable
Error: Not Found
at Bt (C:\Users\Windows\AppData\Local\GitHubDesktop\app-3.2.3\webpack:\app\src\lib\http.ts:178:11)
at En.fetchPushControl (C:\Users\Windows\AppData\Local\GitHubDesktop\app-3.2.3\webpack:\app\src\lib\api.ts:1522:7)
at ir.refreshBranchProtectionState (C:\Users\Windows\AppData\Local\GitHubDesktop\app-3.2.3\webpack:\app\src\lib\stores\app-store.ts:1148:39)
at C:\Users\Windows\AppData\Local\GitHubDesktop\app-3.2.3\webpack:\app\src\lib\stores\app-store.ts:4852:32
at ir.withPushPullFetch (C:\Users\Windows\AppData\Local\GitHubDesktop\app-3.2.3\webpack:\app\src\lib\stores\app-store.ts:4367:5)
at ir.performFetch (C:\Users\Windows\AppData\Local\GitHubDesktop\app-3.2.3\webpack:\app\src\lib\stores\app-store.ts:4808:5)
at Mo.performAndScheduleFetch (C:\Users\Windows\AppData\Local\GitHubDesktop\app-3.2.3\webpack:\app\src\lib\stores\helpers\background-fetcher.ts:102:7)
2023-05-11T13:31:39.742Z - info: [ui] [Timing] Action 'create commit' for 'JeroenBos/JBNA' took 0.000s
2023-05-11T13:32:10.462Z - info: [ui] Executing Squash: git -c sequence.editor=cat "C:\Users\Windows\AppData\Local\Temp\squashTodo-j9Zonk\squashTodo" > rebase -i 3f75247f48251bd436af366b06673a9a28e16ca1^ (took 30.677s)
2023-05-11T13:32:10.468Z - info: [ui] [squash] starting rebase for format at e46e133de43ab86759506eec3b3ff635e5c24ef0
2023-05-11T13:32:10.468Z - info: [ui] [squash] to restore the previous state if this completed rebase is unsatisfactory:
2023-05-11T13:32:10.468Z - info: [ui] [squash] - git checkout format
2023-05-11T13:32:10.468Z - info: [ui] [squash] - git reset e46e133de43ab86759506eec3b3ff635e5c24ef0 --hard
Screenshots
No response
Additional context
The timeout does not occur when
- there is no post checkout hook
- the hook does not start with
#!/bin/bash(but e.g. with#!/bin/sh)
EDIT: I have it with normal commits too, not just rebases.
Metadata
Metadata
Assignees
Labels
investigation-neededLikely bugs, but haven't been reliably reproduced by a reviewer
Activity
steveward commentedon May 11, 2023
@JeroenBos thanks for the issue! Could you upload the log file from GitHub Desktop so that I could see if that shows anything interesting? To access the log files go to the file menu in GitHub Desktop and select
Help>Show Logs. The log files are created daily -- please upload a log file as an attachment from a day where you experienced the issue.JeroenBos commentedon May 11, 2023
I edited my post and added minimal logs. As a description of what I did:
I did the squash operation twice:
#!/bin/sh, which was pretty much instantaneous#!/bin/bash, which has the 30 second timeout (even with empty~/.bashrc)I see that the logs are about ssh, so I'll add some related information:
[-]Rebasing idles for 30s[/-][+]Committing idles for 30s[/+]JeroenBos commentedon May 15, 2023
I rebuilt an older version (3.2.0) from source, as I'm certain I didn't have the above behavior yet in that timeframe. I could still observe it with that version, so I concluce it has nothing to do with GitHub Desktop, and I'll have to look elsewhere for this puzzling behavior. Sorry for the inconvenience.
JeroenBos commentedon May 16, 2023
Well, I am starting to think it is related to GitHub desktop.
A
git commitcommand from shell works fine, no idling. A commit from GitHub Desktop idles, and I've figured out that it is related to WSL2.Somehow the
bashvsshdifference triggers WSL in GitHub desktop, but not in regular git usage.I found out by disabling hyperv in BIOS, after which committing in GitHub desktop gave me the following error:
After uninstalling WSL (properly, as in including unticking the “Windows Subsystem for Linux” option in the Windows Features dialog box), this issue was resolved.
Now, I don't use WSL for anything. Admittedly I had installed it to try something, and ever since I've been having this issue with GitHub Desktop, but I didn't think of it. Merely installing WSL2 shouldn't affect GitHub Desktop imho.
JeroenBos commentedon May 16, 2023
What I think is going on:
git -c credential.helper= fetch --progress --prune --recurse-submodules=on-demand originThat hangs. Possibly that trying to execute something in WSL hangs (because it isn't running on my system), or maybe it is started and then it hangs on the message
Enter passphrase for ~/.ssh/id_rsa:as WSL for sure can't find thessh-agent(which is running on the Windows side). Either could explain the the 30s wait. The problem is that it shouldn't be using WSL for anything in the first place.[-]Committing idles for 30s[/-][+]WSL is used where it shouldn't, causing 30s idle[/+]aleixrodriala commentedon Mar 26, 2026
I've been struggling with this for a while and ended up building a fork that fixes it: GithubDesktopWSL
Think of it like the VS Code Remote WSL extension but for GitHub Desktop. It runs a small daemon inside WSL that handles git and file operations natively over TCP instead of going through 9P.
I went with a patch-based approach so it auto-syncs with upstream releases. You can just download the installer and try it, installs side-by-side with official Desktop.
Would love if anyone here could give it a try and let me know how it goes!
coleleavitt commentedon May 2, 2026
I've put together a PR that addresses this and several related WSL issues: #22043
Approach: When a repository is on a WSL filesystem (
\\wsl.localhost\or\\wsl$\), route safe git subcommands throughwsl.exe -e gitinstead of Windowsgit.exe. This bypasses the 9P filesystem boundary entirely.Results on a ~500 file WSL repo:
git status: 2-6s → 100-300ms (10-20x faster)git log: 1-4s → 50-200ms (10-20x faster)git diff: 1-3s → 50-150ms (10-20x faster)The 30s idle timeout from this issue is also addressed — bash hooks in
.git/hooks/were triggering WSL detection and hanging. With native WSL routing, hooks execute in the correct WSL context natively.Also includes platform-wide perf improvements (commit-graph,
--no-write-fetch-head,GIT_OPTIONAL_LOCKS=0,core.fsmonitoron clone) and a 120s trampoline socket timeout to prevent infinite "Fetching origin / Hang on..." hangs.All 1305 tests pass. Feature-gated behind
enableWSLPerformanceOptimizations().