Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For anyone interested, I solved this problem for my own needs using what I think is a unique approach, available here:

https://github.com/rustyio/git-gpg

As the name suggests, it uses gpg to encrypt and decrypt the data.

Unlike git-encrypt and git-crypt, it doesn't use smudge/clean filters.

Instead, it uses a special command (`git-gpg push $remote`) to push changes to a local unencrypted mirror of the remote repository. It then encrypts any newly created git objects, and finally rsyncs the new objects to the remote repository. So the remote is just a directory of zipped, gpg-encrypted files.

It has worked well for me over the past two years, but I don't expect that it solves every edge case.

Feedback welcomed through issues and pull requests.



I'm sure it works well for you, and you might be aware - but just in case you aren't, that's what "git remotes" are all about - you can write a remote helper instead, and "git push gpg://...." instead of "git gpg push". That's how p4, mercurial, etc client bridges are implemented.

See [0] for more. Obviously, this might be overkill for your use case, but this is the "right" way to do it.

[0] https://www.kernel.org/pub/software/scm/git/docs/gitremote-h...


I'm assuming this doesn't work to push to GitHub though, right?


Right.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: