github.com/StackExchange/blackbox/v2@v2.0.1-0.20220331193400-d84e904973ab/docs/git-tips.md (about) 1 GIT tips 2 ======== 3 4 5 # Configure git to show diffs in encrypted files 6 7 It's possible to tell Git to decrypt versions of the file before running them through `git diff` or `git log`. To achieve this do: 8 9 - Add the following to `.gitattributes` at the top of the git repository: 10 11 ``` 12 *.gpg diff=blackbox 13 ``` 14 15 - Add the following to `.git/config`: 16 17 ``` 18 [diff "blackbox"] 19 textconv = gpg --use-agent -q --batch --decrypt 20 ```` 21 22 Commands like `git log -p file.gpg` and `git diff master --` will display as expected.