Verify your submission using GPG

Time:2021-10-16

Recently, it was found that gitee.com, like github.com, began to use GPG submission verification
After tossing around for a long time, I found that my commit didn’t have a green icon. So I studied it and found that it should be super simple to use GPG suite

Install first

brew cask install gpg-suite

After installation
implement

gpg --full-generate-key

Generate 4096 bit GPG certificate according to the guidelines
then

gpg --list-secret-keys --keyid-format LONG
/Users/hainuo/.gnupg/pubring.kbx
--------------------------------
sec   rsa4096/4EF051CE87404F85 2019-10-19 [SC]
      A7C99*****1CE87404F85
Uid [absolute] Hainuo (GPG long time)< [email protected] >
ssb   rsa4096/02F3D*****539B3 2019-10-19 [E]

Get GPG key ID
4EF051CE87404F85
Then execute

git config --global gpg.program /usr/local/bin/gpg
git config --global user.signingkey 4EF051CE87404F85 
git config --global commit.gpgsign true

Important things are to be repeated for 3 timesDon't forget git config -- global commit.gpgsign true Don't forget git config -- global commit.gpgsign true Don't forget git config -- global commit.gpgsign true

Then you can executegit commitcommand
__
To verify that GPG is available, you can use the following command

echo "test" | gpg --clearsign
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

test
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEp8mSy95BeI+BjUpmTvBRzodAT4UFAl2rDMQACgkQTvBRzodA
T4XZ5g//ZiqwzemGbOUDsbgz2KHd/25qdzz+U+KS3bFUc4dw6ouZcXD5iaPwwD17
**********
8xyfbICPyK+F2SaVveSxQCANGg2SgsKWL4zDqA5ztrtwLp98Lvbbw/zSLyz2tio3
Ob/yDvp6fTA81IzBa4ASJaaeUAFHLz2TNGhZWQf9C6XB34P4at0=
=W1Bt
-----END PGP SIGNATURE-----

Publish using openwrite