Git commit signature

In case you need sign your commit - a verified signature on GitHub commit history. Here it is. I have already added my GPG key to GitHub.


# Check GPU key
$   gpg --list-secret-keys --keyid-format=long
/home/rajesh/.gnupg/pubring.kbx
-------------------------------
sec   rsa2048/DD95F119EA64BABE 2011-02-11 [SCA]
      79B36A390B6A4BBFA103483BDD95F119EA64BABE

# Tell Git about your signing key
$  git config --global user.signingkey DD95F119EA64BABE

# Instruct to sign every commit
$  git config --global commit.gpgsign true

# Add to startup of terminal
$  [ -f ~/.bashrc ] && echo -e '\nexport GPG_TTY=$(tty)' >> ~/.bashrc


Reference

  1. https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key
★ 2 min read · Rajesh Pandian M · git , gpg