Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to show diffs for gpg-encrypted files?
*.gpg filter=gpg diff=gpg
*.asc filter=gpg diff=gpg

How to show diffs for gpg-encrypted files?

Git supports showing diffs for encrypted files, but has to be told to do so.

git config --global diff.gpg.textconv "gpg --no-tty --decrypt"
echo "*.gpg filter=gpg diff=gpg" >> .gitattributes
echo "*.asc filter=gpg diff=gpg" >> .gitattributes

or

curl -sL https://gist.github.com/marcelosousaalmeida/e6593b93b388cdf1dbc282dffd424d1b/raw/.gitattributes -o .gitattributes
@anastygnome

This comment has been minimized.

Copy link

@anastygnome anastygnome commented Apr 13, 2021

One may also find the following useful :
git config diff.gpg.textconv "gpg2 --decrypt -q"

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