Last Updated: September 21, 2016
· sukima

Tracking ASCII armored PGP/GPG keys with Git

Since PGP keys are not something that can be merged as text and are quite meaning less in a diff this trick allows you to have a human readable version of the changes.

Add this to your Git config (global $HOME/.gitconfig or per repo ./.git/config):

[diff "pgp"]
  textconv = gpg -v

Now in the repo that contains a PGP key simply add this to a .gitattributes file:

*.asc diff=pgp -merge
Say Thanks
Filed Under

Awesome Job

0957a9c2 0855 11e8 909a 82469fe19f14
Senior Backend Engineer
San Francisco, California
Full Time