Instantly share code, notes, and snippets.

@LauLaman /gpg.md
Last active Nov 17, 2018

Embed
What would you like to do?
Use GPG to sign commits using git & PHPStorm

1 - install GPG tools : https://gpgtools.org/

2 - Create new key for your github email

3 - Add key to git on your local machine: git config --global user.signingkey YOURKEY

4 - configure git to sign all commits: git config --global commit.gpgsign true

5 - add to the bottom of ~/.gnupg/gpg.conf:

no-tty
use-agent

6 - Add key to you're github profile settings: gpg --armor --export YOURKEY

@jhnns

This comment has been minimized.

jhnns commented Nov 4, 2016

Nice. This works for me! 👍

@BlackIkeEagle

This comment has been minimized.

BlackIkeEagle commented Feb 21, 2017

To make it not so github specific you should publish your key to a keyserver https://www.gnupg.org/gph/en/manual/x457.html

@mf81bln

This comment has been minimized.

mf81bln commented Apr 27, 2017

Very nice! Helped me a lot 👍

@stefanvangastel

This comment has been minimized.

stefanvangastel commented Sep 11, 2017

Note: git config --global commit.gpgsign true only works in git >= 2.0.0.

@tdlm

This comment has been minimized.

tdlm commented Sep 29, 2017

This works great 👍, but it helps to know that, for me, YOURKEY meant the Key ID from inside GPG Tools.

@bologer

This comment has been minimized.

bologer commented Jun 19, 2018

@stefanvangastel dude, you saved my life, I was trying gpgsign multiple times and all failed, as I had 1.9 git version 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment