Posted on

Related discussion (some interesting URLs) in my QA repo.

Key takeaways:

Make sure to configure your username, email and GPG signing key, and sometimes check the GPG version too:

git config --global --list

After generating your key, you can see its info with:

gpg --list-secret-keys --keyid-format=long

If gpg -a --export your@email fails, try one of these instead to get your public key for GitHub (or GitLab):

gpg --armor --export 7E98CBC76F9B33F8
# or, using the key ID
gpg --export -a 5E0E8CB44844126F

Make sure to set:

export GPG_TTY=$(tty)

If it still fails, check for errors here:

systemctl --user status gpg-agent

As a last resort, change the pinentry program:

cat ~/.gnupg/gpg-agent.conf
# pinentry-program /usr/bin/pinentry-curses