1

I need help with gpg key in git. First I export keys from windows with this:

gpg --output backupkeys.pgp --armor --export-secret-keys --export-options export-backup user@email

Then on linux I import this key

gpg --import backupkeys.pgp 

and change from unknown to ultimate. So this is how I import this key to linux. But now I need add gpg key to git, so I do this:

git config --global user.signingkey mySuperKey

but when I can create commit

git commit -S -m "Super Commit" 

I have this output

error: gpg failed to sign the data
fatal: failed to write commit object

I don't know where is problem.

ERROR_404
  • 25
  • 4
  • Does gpg work by itself? What happens if you run `echo hello world | gpg -sa -u user@email`? – larsks Jan 17 '22 at 13:06
  • Probably no `gpg: signing failed: Inappropriate ioctl for device -----BEGIN PGP MESSAGE----- gpg: signing failed: Inappropriate ioctl for device` – ERROR_404 Jan 17 '22 at 13:39

1 Answers1

0

After trying exporting new GPG keys and later import. I found answare for this problem.

echo hello world | gpg -sa -u user@email

if I try this don't show this:

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

So all what I need to do is this:

export GPG_TTY=$(tty)
ERROR_404
  • 25
  • 4