Skip to content

Instantly share code, notes, and snippets.

@veevidify
Last active March 23, 2022 11:39
Show Gist options
  • Save veevidify/068485fc59ad17df326d182980b6db4b to your computer and use it in GitHub Desktop.
Save veevidify/068485fc59ad17df326d182980b6db4b to your computer and use it in GitHub Desktop.
Commit signing

New GPG key

  • Gen key
$ gpg --full-gen-key
  • List
$ gpg --list-keys
  • Export pub key
$ gpg --armor --export {key_id}
  • Then add pub key to remote

Config git

  • Permission ensure
$ sudo chmod 600 ~/.gnupg/*
$ sudo chmod 700 ~/.gnupg
  • Run this in console & also add in .bashrc or .zshrc
$ export GPG_TTY=$(tty)
  • Git
$ gpg --list-secret-keys --keyid-format=long
  • Specify key
$ git config commit.gpgSign true
$ git config user.signingKey {key_id}
  • Opt config
$ git config --global commit.gpgSign true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment