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
{{ message }}
Repository navigation
git command "exited with an unexpected code: 1" #17362
My GitHub Desktop constantly says error launching git: or Git returned an unexpected exit code '1' which should be handled by the caller (getStatus).', and finally it may say that it can't find my repository. I can click "Locate..." to open the repository again, but the error occurs again. It seems that each git command can fail like this.
In PowerShell, I ran the command that is said to "exited with an unexpected code: 1" in the log, e.g.
C:\Users\<username>\AppData\Local\GitHubDesktop\app-3.3.1\resources\app\git\cmd\git.exe log -g --no-abbrev-commit --pretty=oneline HEAD -n 2500--
And nothing went wrong.
Also, this error can occur for any repository. Sometimes it just happens randomly.
Release version
3.3.1
Operating system
Windows 11
Steps to reproduce the behavior
Log files
This is an example; The log also shows a lot of git commands that "exited with an unexpected code: 1"
2023-09-09T13:46:16.512Z - error: [ui] `git log -g --no-abbrev-commit --pretty=oneline HEAD -n 2500 --` exited with an unexpected code: 1.
stderr:
error launching git:
@ycwang-hello thanks for the issue. In the past this has sometimes been resolved by trying a fresh install. Could you try performing a fresh installation of GitHub Desktop by following these steps?
Here's how to do that:
Close GitHub Desktop
Open File Explorer
Go to %LocalAppData% and delete the GitHubDesktop directory
Go to %AppData% and delete the GitHub Desktop directory
Thanks a lot for the response @steveward. After a fresh installation, I can add some repositories and use it without errors. However, if I close and reopen GitHub Desktop, I encounter the same error again.
Activity
steveward commentedon Sep 11, 2023
@ycwang-hello thanks for the issue. In the past this has sometimes been resolved by trying a fresh install. Could you try performing a fresh installation of GitHub Desktop by following these steps?
Here's how to do that:
%LocalAppData%and delete theGitHubDesktopdirectory%AppData%and delete theGitHub DesktopdirectoryLet me know if that helps at all.
ycwang-hello commentedon Sep 14, 2023
Thanks a lot for the response @steveward. After a fresh installation, I can add some repositories and use it without errors. However, if I close and reopen GitHub Desktop, I encounter the same error again.
steveward commentedon Sep 14, 2023
Is there any security software on your machine that could be interfering with GitHub Desktop?
Unfortunately there isn't much info in the logs about what specifically is causing this.
ycwang-hello commentedon Sep 15, 2023
I have confirmed that it is due to the security software. With the security software paused, I see no error using the GitHub Desktop. Thank you!