desktop / desktop

Focus on what matters instead of fighting with Git.
https://desktop.github.com
MIT License
19.44k stars 9.3k forks source link

Git commit error #18807

Open doekman opened 2 weeks ago

doekman commented 2 weeks ago

The problem

Since I've configured git to use ssh to sign commits with, I can't commit with GitHub Desktop. I get the following error:

error: could not create temporary file: No such file or directory
fatal: failed to write commit object

However, when I create a commit from the command-line, it works fine:

git commit -S -m "xxxx"
# and also without creating a signed commit
git commit -m "xxxx"

When I look at GitHub Desktop's log file:

2024-06-10T09:38:29.036Z - error: [ui] `git commit -F -` exited with an unexpected code: 128.
stderr:
error: could not create temporary file: No such file or directory
fatal: failed to write commit object

2024-06-10T09:38:29.042Z - info: [ui] [Timing] Action 'create commit' for 'aiwa' took 0.047s

However, when I run the command manually:

echo "xxxx" | git commit -F -

it works just fine. What could be the problem...

Release version

Version 3.4.1 (arm64)

Operating system

MacOS Sonoma 14.5 (23F79)

Steps to reproduce the behavior

  1. change a file
  2. commit via github desktop

Log files

2024-06-10.desktop.production.log

Screenshots

Scherm­afbeelding 2024-06-10 om 11 52 37

Additional context

No response

steveward commented 2 weeks ago

Thanks for the repot @doekman. Can you open GitHub Desktop from the command line by running github .? This will let the app inherit your environment setup -- let me know if that resolves the issue.

doekman commented 2 weeks ago

Yes, that solves the problem.

But is there a more permanent to fix it?

steveward commented 2 weeks ago

Can you share your .gitconfig setup for your key? There is a known issue with passphrases as well, see https://github.com/desktop/desktop/issues/17284.

doekman commented 2 weeks ago

Here is my_gitconfig.zip, zipped.