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 }}
This repository was archived by the owner on Nov 18, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 18, 2021. It is now read-only.
GitHub Desktop: error: cannot run gpg: No such file or directory #675
Whenever I click the "Commit to master" button on GitHub Desktop on OSX, I get:
error: cannot run gpg: No such file or directory
error: could not run gpg.
fatal: failed to write commit object
(128)
Using GitHub Desktop version Beset by Computers (220) on OS X 10.11.4 (15E65)
$ git --version
git version 2.8.2
$ gpg --version
gpg (GnuPG) 1.4.20
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Home: ~/.gnupg
Supported algorithms:
Pubkey: RSA, RSA-E, RSA-S, ELG-E, DSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
$ git config --list # truncated
user.signingkey=MYKEYCODE
commit.gpgsign=true
Reacted by Anil Kulkarni, JedatKinports, 叶世清, José Cage , Shravan Rajinikanth, Suriyaa Sundararuban, FlyDjango, Andrei Simionescu, Eremity, Liam Read and 2 more
So as GitHub Desktop was complaining about not being able to find gpg (I had installed it via homebrew), I figured there should be a way to tell git the exact path of gpg, turns out there is:
gpg.program
Use this custom program instead of "gpg" found on $PATH when making or verifying a PGP signature. The program must support the same command-line interface as GPG, namely, to verify a detached signature, "gpg --verify $file - <$signature" is run, and the program is expected to signal a good signature by exiting with code 0, and to generate an ASCII-armored detached signature, the standard input of "gpg -bsau $key" is fed with the contents to be signed, and the program is expected to send the result to its standard output. https://git-scm.com/docs/git-config
So running the following solved the problem:
git config --global gpg.program $(which gpg)
GitHub got back to me and said that some users also need to use (why this is needed I have no idea):
echo "no-tty" >> ~/.gnupg/gpg.conf
I've automated this via the setup-git command from the dotfiles I use:
Reacted by Anees Iqbal, Guillaume, Moritz, Eddy Hernandez, Jean Bredeche, Piotr Kowalski, Sebastian Schmidt, Mahmoud Maghraby, Olivier Tille, Kyle Keesling and 158 more
Reacted by inoas, Anil Kulkarni, Steph-W, German Attanasio, José Cage , Vieko Franetovic, D, will Farrell, Andrei Simionescu, Vlad Cherednychenko and 10 more
Reacted by Piotr Kowalski, Mahmoud Maghraby, Almad, Thomas Schoffelen, John HU, inoas, Nitin Yawalkar, Anil Kulkarni, Zach Curtis, Greg P and 29 more
Reacted by Mehmet Emin Kartal, inoas, Ciocanel Razvan, Javier Sanchez Toledano, Dave Teare, Anil Kulkarni, Priscila Apocalypse, Aakash Goel, Dennis Weissmann, Steph-W and 33 more
Reacted by Kristiyan Dobrev, Matheus Gonçalves, AverageHelper and Lauri Välja
Any way to get this working with Passphrase?
Getting this error after using the two commands provided by @balupton
gpg: Sorry, no terminal at all requested - can't get input
error: gpg failed to sign the data
fatal: failed to write commit object
(128)
Reacted by Anderson Dourado, Joe H, Kristian Hellang, Sander ten Veldhuis, The web walker, Anthony Lawson, FireController#1847, Android, AlterwebStudio, Eremity and 1 more
This is my gist that explain how to enable auto-signing of Git commits for EVERY programs that don't support it natively..
It's specifically for Windows systems!!
So as GitHub Desktop was complaining about not being able to find gpg (I had installed it via homebrew), I figured there should be a way to tell git the exact path of gpg, turns out there is:
gpg.program
Use this custom program instead of "gpg" found on $PATH when making or verifying a PGP signature. The program must support the same command-line interface as GPG, namely, to verify a detached signature, "gpg --verify $file - <$signature" is run, and the program is expected to signal a good signature by exiting with code 0, and to generate an ASCII-armored detached signature, the standard input of "gpg -bsau $key" is fed with the contents to be signed, and the program is expected to send the result to its standard output. https://git-scm.com/docs/git-config
So running the following solved the problem:
git config --global gpg.program $(which gpg)
GitHub got back to me and said that some users also need to use (why this is needed I have no idea):
So as GitHub Desktop was complaining about not being able to find gpg (I had installed it via homebrew), I figured there should be a way to tell git the exact path of gpg, turns out there is:
gpg.program
Use this custom program instead of "gpg" found on $PATH when making or verifying a PGP signature. The program must support the same command-line interface as GPG, namely, to verify a detached signature, "gpg --verify $file - <$signature" is run, and the program is expected to signal a good signature by exiting with code 0, and to generate an ASCII-armored detached signature, the standard input of "gpg -bsau $key" is fed with the contents to be signed, and the program is expected to send the result to its standard output. https://git-scm.com/docs/git-config
So running the following solved the problem:
git config --global gpg.program $(which gpg)
GitHub got back to me and said that some users also need to use (why this is needed I have no idea):
Activity
balupton commentedon May 16, 2016
Tracked here too it seems http://stackoverflow.com/q/36941533/130638
added gpg.program to fix isaacs/github#675
balupton commentedon May 16, 2016
Solved it via workaround.
So as GitHub Desktop was complaining about not being able to find gpg (I had installed it via homebrew), I figured there should be a way to tell git the exact path of gpg, turns out there is:
So running the following solved the problem:
GitHub got back to me and said that some users also need to use (why this is needed I have no idea):
I've automated this via the
setup-gitcommand from the dotfiles I use:https://github.com/bevry/dotfiles
mathieudutour commentedon Jul 15, 2016
Without it, I had this error:
cannot open /dev/tty': device not configuredfreak4pc commentedon Jul 21, 2016
Any way to get this working with Passphrase?
Getting this error after using the two commands provided by @balupton
MikeLund commentedon Aug 15, 2016
Try out this process out @freak4pc, works well for me: https://gist.github.com/bmhatfield/cc21ec0a3a2df963bffa3c1f884b676b
workaround for GitHub Desktop gpg sign error.
MuhsinFatih commentedon Jun 11, 2017
In my case as I use gpg2 it was:
added gpg.program to fix isaacs/github#675
BoGnY commentedon Jan 5, 2018
This is my gist that explain how to enable auto-signing of Git commits for EVERY programs that don't support it natively..
It's specifically for Windows systems!!
NatoBoram commentedon Apr 17, 2018
I tried
no-tty, but then I getGit: gpg: Sorry, no terminal at all requested - can't get input.git config --global gpg.program /usr/bin/gpg gpg-agent gpg-agent[5485]: gpg-agent running and available cat ~/.gnupg/gpg-agent.conf allow-preset-passphrase default-cache-ttl 28800 pinentry-program /usr/bin/pinentry-gnome3Emacs - Fix magit commit errors after updating Spacemacs
freak4pc commentedon Mar 1, 2019
Well, that's not really a solution, that entirely turns off Verified Commits :)
bobbysiagian00 commentedon Jul 29, 2019
I highly suggest to follow this gist,
then everything goes well.
note: for several cases, if you can't generate the key, ensure you have to remove no-tty line from ~/.gnupg/gpg.conf
jstiers commentedon Apr 23, 2020
Awesome, thank you !
gitmatheus commentedon Sep 30, 2020
Worked for me. Thanks!