
- Get key id:
gpg --list-secret-keys.$KEYIDis assumed to be the key id. - Export private key:
gpg --export-secret-keys -a $KEYID > private_key.asc - Export public key:
gpg --export -a keyid > public_key.asc - Import private key:
gpg --import private_key.asc - Trust the key:
gpg --edit-key [email protected]. Type in the commandtrust, then select “I trust ultimately”. Usequitto quit.
Configure git to use the GPG key, and sign commits automatically:
git config --global user.signingkey $KEYIDgit config --global commit.gpgSign true




近期评论