How to sign commits in Jujutsu (jj) and Git
A brief guide on how to sign commits in Jujutsu (jj) and Git using GPG/PGP keys.
Assuming you don’t have a GPG/PGP key yet, you can generate one using the following command:
gpg --full-generate-keyWhen greeted with the prompt, I would go with ECC (sign and encrypt):
Please select what kind of key you want:
(1) RSA and RSA
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
(9) ECC (sign and encrypt) *default*
(10) ECC (sign only)
(14) Existing key from card Your selection?Then, if it asks you for an elliptic curve, choose Curve 25519, usually the default:
Please select which elliptic curve you want:
(1) Curve 25519 *default*
...Enter your name and email address when prompted.
Choose a strong passphrase for your key.
I would go with no expiration date for the key, but you can choose an expiration date if you prefer.
Export your public and private key each to a file:
gpg --list-secret-keys --keyid-format=longYou’ll see something like:
sec ed25519/ABCDEF1234567890 2026-09-03 [SC]Then export the public key:
gpg --armor --export ABCDEF1234567890 > public-key.ascAnd export the private key:
gpg --armor --export-secret-keys ABCDEF1234567890 > private-key.ascTo import later, you can use the following commands:
gpg --import public-key.asc
gpg --import private-key.ascBack up these keys and the revocation certificate GnuPG automatically creates. It’s normally under:
ls -lah ~/.gnupg/openpgp-revocs.d/Add your key to your GitHub account (or other Git hosting service) by
copying the contents of public-key.asc and
pasting it into the GPG keys section of your account settings.
If you don’t have the email address associated with your GPG key in your GitHub account, you can add it by going to your email settings.
Add this to your Git configuration:
[user]
name = Gorilla Moe
email = me@gorilla.moe
signingkey = ABCDEF1234567890For Jujutsu (jj), you can add the following to your configuration:
"$schema" = "https://jj-vcs.github.io/jj/latest/config-schema.json"
[user]
name = "Gorilla Moe"
email = "me@gorilla.moe"
[signing]
behavior = "own"
backend = "gpg"
backends.gpg.program = "gpg2"Make sure to replace Gorilla Moe, me@gorilla.moe (and ABCDEF1234567890 in gitconfig) with your own values.