How to Configure GPG Key for GitHub | Verify Git Commits with GPG Signature (Step-by-Step Guide)
Nov 19, 2025
Want to add the green "Verified" badge to your GitHub commits? π
In this step-by-step tutorial, I will show you how to configure a GPG key for your GitHub project so your commits become secure, trusted, and identity-verified.
Whether you are a beginner or an experienced developer, this guide will help you set up GPG signing correctly on your system.
1) Install GPG on Linux System
sudo apt install gnupg
2)Generate a New GPG Key
gpg --full-generate-key
Or generate quickly without passphrase using:
gpg --batch --passphrase "" --quick-generate-key "Enter-Your-Email-Address" rsa4096
3) List Your GPG Keys
gpg --list-secret-keys --keyid-format=long
4) Export Your Public Key for GitHub
gpg --armor --export 'gpg-key-id'
Show More Show Less 