Step 1: Check if gpg installed
gpg --version
Step 2: Generate a key
gpg --full-gen-key
Select (1) option, (RSA and RSA) You can also select 4th option (RSA Sign Only)
Enter key size between 1024 and 4096
4096
Expiry:
Enter 0 for no expiry, then proceed with typing y for confirmation.
Now, it will ask some basic details like
Name,
Email
Comment (Entering your profession here is a good idea)
Enter pass phrase
done.
Get the newly generated gpg key,
gpg --armour --export <keyIDHere_DEMOX1234>
You can get the keyID by
gpg --list-keys
Copy the entire key, paste on github gpg keys.
Set the gpg key for git.
git config --global user.signingkey <keyIDHere_DEMOX1234>
You can get the keyID by
gpg --list-keys
Enable signing in git:
git config --global commit.gpgsign true
Open vscode, and settings search for git enable signing in settings.
Make sure Enable commit Signing option is checked.
All done Make Verified commits now!