Skip to content

Instantly share code, notes, and snippets.

@sharjeelaziz
Last active December 17, 2019 01:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sharjeelaziz/d7af55dbedccf86b560c0ee2b631e01d to your computer and use it in GitHub Desktop.
Save sharjeelaziz/d7af55dbedccf86b560c0ee2b631e01d to your computer and use it in GitHub Desktop.
Workaround when git commit -S fails / gpg / yubikey

git commit with -S option fails:

When getting the following error:

shaji:netatmo-to-json/ (master✗) $ git commit -S -m "systemd support and refactoring"
error: gpg failed to sign the data
fatal: failed to write commit object
echo "test" | gpg --clearsign

gpg: signing failed: Inappropriate ioctl for device
gpg: [stdin]: clear-sign failed: Inappropriate ioctl for device

If the above command fails:

export GPG_TTY=$(tty)

Try again and the first command below should ask for pinentry. If it does you should be able to commit:

echo "test" | gpg --clearsign
git config -l | grep gpg
gpg.program=gpg commit.gpgsign=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment