Situation
Hi, I would like to save data with git, encrypted (on some platform like bitbucket or github). Therefore the question:
Question
I am looking for different hassle-free ways on:
How to set up an encrypted repository on bitbucket(/github)?
Now, I am new to git, thus an instruction with all necessary steps or step by step would be much appreciated!
"Research"
git-crypt
I found git-crypt, but on the site it is mentioned that it's intended for single file encryption. If one wanted to encrypt the whole repository they forward to git-remote-gcrypt.
git-remote-gcrypt
In their README.rst they put it as simple as
Quickstart
git remote add cryptremote gcrypt::rsync://example.com:repo
git push cryptremote master
> gcrypt: Setting up new repository
> gcrypt: Remote ID is :id:7VigUnLVYVtZx8oir34R
> [ more lines .. ]
> To gcrypt::[...]
> * [new branch] master -> master
or under
Examples
# notice that the target git repo must already exist and its
# `next` branch will be overwritten!
git remote add gitcrypt gcrypt::git@example.com:repo#next
git push gitcrypt master
Tries
I prefer full repository encryption, hence I tried git-remote-gcrypt
with variations of the Quickstart and Example.
So far I tried pushing an existing repository by following their instructions. Which yields this: (note: I have purposely changed the username to user
)
-> with ssh
as in the provided example
[...]/git_test$ git remote add origin gcrypt::git@bitbucket.org:user/test.git
[...]/git_test$ git push -u origin --allgcrypt: Development version -- Repository format MAY CHANGE
gcrypt: Repository not found: git@bitbucket.org:user/test.git
gcrypt: Setting up new repository
gcrypt: Remote ID is :id: ...
Zähle Objekte: 10, Fertig.
Komprimiere Objekte: 100% (6/6), Fertig.
Total 10 (delta 0), reused 0 (delta 0)
gcrypt: Encrypting to: --throw-keyids --default-recipient-self
gcrypt: Requesting manifest signature
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
error: Fehler beim Versenden einiger Referenzen nach 'gcrypt::git@bitbucket.org:user/test.git'
or with https
(which worked)
[...]/git_test$ git remote add gitcrypt gcrypt::https://user@bitbucket.org/user/test.git
[...]/git_test$ git push -u gitcrypt --allgcrypt: Development version -- Repository format MAY CHANGE
Password for 'https://user@bitbucket.org':
gcrypt: Repository not found: https://user@bitbucket.org/user/test.git
gcrypt: Setting up new repository
Password for 'https://user@bitbucket.org':
gcrypt: Remote ID is :id: ...
Zähle Objekte: 10, Fertig.
Komprimiere Objekte: 100% (6/6), Fertig.
Total 10 (delta 0), reused 0 (delta 0)
gcrypt: Encrypting to: --throw-keyids --default-recipient-self
gcrypt: Requesting manifest signature
Password for 'https://user@bitbucket.org':
To gcrypt::https://user@bitbucket.org/user/test.git
* [new branch] master -> master
Branch master konfiguriert zum Folgen von Remote-Branch master von gitcrypt.
Nevertheless, I don't understand how to add users or even just pull my backup onto another machine (since my gpg key was generated locally) !?
Feel free to just answer on usage of git-remote-gcrypt
.