Last Updated: August 02, 2019
· acasajus

Encrypt password files and sensitive info in your git repo

I use git-blur to encrypt sensitive information in my git repos.

Say I've got all my home config in my dotfiles repo in github. This repo has ssh configuration and host definitions that I don't want anyone (except me) to see. The rest of the repo is public and I welcome everyone to take advantage of it as I took advantage of other great dotfiles repos but the ssh part I want to keep private. I just

$ git blur init

In my dotfiles repo to create the key file to encrypt/decrypt files. And I then just need to add which files I want to "blur" in my .gitattributes file:

$ cat .gitattributes
secretfile filter=git-blur diff=git-blur
*.key filter=git-blur diff=git-blur

and that's it. In my workspace files are clear as day but for git they are completely encrypted.