Encrypt git repository content before pushing

Created at 2026-10-03 19:03
Last edited at 2026-10-21 20:09

https://github.com/spwhitton/git-remote-gcrypt

git-remote-gcrypt will encrypt the repo content using GPG before pushing to the remote.

Install git-remote-gcrypt

Ubuntu:

sudo apt install git-remote-gcrypt

Generate a GPG key if you don’t have one already

gpg --full-gen-key

Git repo setup

Create git repository as usual

git init .

Configure the remote

Using ssh:

git remote add origin gcrypt::git@my.remote.url:myuser/myrepo

Using https:

git remote add origin gcrypt::https://my.remote.url/myuser/myrepo

Editing an existing remote url

git config remote.origin.url gcrypt::git@my.remote.url:myuser/myrepo