How to configure git using a key created on another machine
Install the needed packages (including those needed for Yubikey)
1
sudo apt-get install pcscd scdaemon gnupg2 pcsc-tools
Import the public key
1
gpg2 --import < public.key
With the key-holder (or the card, or the yubikey) connected, gather the KEYID with the command:
1
gpg2 --card-status
Next step is to trust the key:
1
2
3
gpg2 --edit-key KEYID
trust
choose 5 = I trust ultimately
Confirm, add the PIN, and the key is ready to be used by git
Configure git with:
1
git config --global user.signingkey KEYID
This post is licensed under CC BY 4.0 by the author.