Encrypted git repositories for privacy made easy
# Create a new remote encrypted repository
gcrypt init [email protected]:user/repo.git
# Encrypt repository already on GitHub
gcrypt encrypt [email protected]:user/repo.git
# Clone encrypted repository
gcrypt clone [email protected]:user/repo.gitapt install git-remote-gcryptnpm i -g LuKks/gcryptMakes easy to work with fully encrypted git repositories.
It uses spwhitton/git-remote-gcrypt, so check it out.
The unique disadvantage that I noticed pushing is a bit slow but not big deal.
Using your GPG key for encryption.
Create an empty repository on GitHub then:
gcrypt init [email protected]:user/repo.git
# or
gcrypt init [email protected]:user/repo.git ~/Desktop/my-encrypted-repogcrypt encrypt [email protected]:user/repo.gitTake caution, it will erase the entire repository (branches, tags, etc),
just keeping a single commit/branch where would be all encrypted togheter.
gcrypt clone [email protected]:user/repo.git
# or
gcrypt clone [email protected]:user/repo.git ~/Desktop/my-encrypted-repoIf you have multiple GPG keys, set which would be used for encryption.
Check your GPG keys list:
gpg --list-secret-keys --keyid-format LONGAnd set it:
git config --global --add gcrypt.participants "A1234B1234C1234D"https://github.com/spwhitton/git-remote-gcrypt/
https://www.alwaysrightinstitute.com/gcrypt/
https://caolan.uk/articles/encrypted-git-repositories/
Code released under the MIT License.