At the prompt, specify the kind of key you
want, or press Enter to accept the default.
At the prompt, specify the key size you want,
or press Enter to accept the default.
Enter the length of time the key should be
valid. Press Enter to specify the default
selection, indicating that the key doesn’t
expire.
Verify that your selections are correct.
Enter your user ID information.
Type a secure passphrase.
Use the gpg —list-secret-keys —keyid-format=long
command to list the long form of the GPG keys for
which you have both a public and private key. A
private key is required for signing commits or
tags.
gpg --list-secret-keys --keyid-format=long
From the list of GPG keys, copy the long form
of the GPG key ID you’d like to use. In this
example, the GPG key ID is 3AA5C34371567BD2: