Repository navigation
Closed
Description
The problem
Inspecting the environment variables of a git process shows that its PATH variable has these additional paths prepended:
C:\Program Files\Git\mingw64\libexec\git-core
C:\Program Files\Git\mingw64\bin
C:\Program Files\Git\usr\bin
GitHub Desktop should detect installation of Git for Windows and incorporate these paths in its environment to fix issues such as #15974.
In my case, GitHub Desktop fails to show diff for files marked with diff=astextplain attribute because C:\Program Files\Git\usr\bin\astextplain is not found.
Release version
3.3.5 (x64)
Operating system
Windows 10.0.19045
Steps to reproduce the behavior
On a Windows environment with GitHub Desktop and Git for Windows installed:
- Create a local git repo with
git init. - Add a
.gitattributesfile with the following line:*.docx diff=astextplain - Add a
word.docxfile to this repo. - Try to view
word.docxdiff in GitHub Desktop and see that it gets stuck in loading animation. - Run
git diffon command line and see that it works there.
Log files
Developer Tools JS Console
install.ts:28 [AppStore] loading 10 repositories from store
install.ts:28 launching: 3.3.5 (Windows 10.0.19045)
install.ts:28 execPath: 'C:\Users\redacted\AppData\Local\GitHubDesktop\app-3.3.5\GitHubDesktop.exe'
app.tsx:300 App ready time: 63.81909999251366ms
app.tsx:301 Load time: 322.42170000076294ms
app.tsx:302 Renderer ready time: 151.90000000596046ms
spawn.ts:136 Uncaught (in promise) Error: Git returned an unexpected exit code '128' which should be handled by the caller (getWorkingDirectoryDiff).'
at ChildProcess.<anonymous> (spawn.ts:136:11)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1091:16)
at Process.onexit (node:internal/child_process:302:5)
(anonymous) @ spawn.ts:136
emit @ node:events:513
maybeClose @ node:internal/child_process:1091
(anonymous) @ node:internal/child_process:302
await in (anonymous) (async)
_selectWorkingDirectoryFiles @ app-store.ts:2803
selectWorkingDirectoryFiles @ dispatcher.ts:306
onFileSelectionChanged @ sidebar.tsx:185
selectSingleRowAfterMouseEvent @ list.tsx:1371
onRowMouseDown @ list.tsx:1323
onRowMouseDown @ list-row.tsx:117
l @ react-dom.production.min.js:14
m @ react-dom.production.min.js:15
(anonymous) @ react-dom.production.min.js:15
x @ react-dom.production.min.js:17
P @ react-dom.production.min.js:18
D @ react-dom.production.min.js:18
N @ react-dom.production.min.js:21
Rn @ react-dom.production.min.js:84
Ta @ react-dom.production.min.js:250
Le @ react-dom.production.min.js:39
Pn @ react-dom.production.min.js:86
(anonymous) @ react-dom.production.min.js:251
t.unstable_runWithPriority @ scheduler.production.min.js:18
Aa @ react-dom.production.min.js:251
An @ react-dom.production.min.js:85
Screenshots
Additional context
No response
Reacted by Syed Abrar Ahmed Shah
Metadata
Metadata
Assignees
Labels
No labels

Activity
ahmetsait commentedon Dec 4, 2023
Thinking about this a bit more, ideally we should have an option to make GitHub Desktop use the already installed Git on the system instead of the one it comes bundled with, which would allow GitHub Desktop to pick up system-wide gitconfig & gitattributes from
C:\Program Files\Git\etcas well as all the tools and scripts Git installation comes with.niik commentedon Dec 20, 2023
Hey @ahmetsait, thanks for reaching out. GitHub Desktop ships with a bundled version of git as that's the only way we can guarantee consistent behavior for all users regardless of what version of Git they run. Have you tried specifying the full path to the
astexplainscript in your gitconfig?ahmetsait commentedon Dec 25, 2023
GitHub Desktop behaves different from
git diffcmd output so I don't know what consistency you're talking about here. Most people would prefer their git tools to pick up all the configuration from their system wide git installation rather than some bundled thing that particular tool comes with.Specifying the full path to
astextplaindoes not solve the problem sinceastextplainuses a bunch of other scripts such asdocx2txt.pl,pdftotext,odt2txtfromC:\Program Files\Git\usr\binandantiwordfromC:\Program Files\Git\mingw64\bin.tidy-dev commentedon Jul 14, 2026
Per #17801 (comment)
ahmetsait commentedon Jul 22, 2026
Sweeping bugs under the rug without actually solving anything. Classic.