情况
嗨,我想用git保存数据,并加密(在某些平台上,如bitbucket或github)。因此,问题是:
题
我正在寻找不同的轻松方式:
如何在bitbucket(/ github)上设置加密存储库?现在,我是git的新手,因此非常感谢所有必要步骤或逐步说明的指导!
“研究”
git-crypt
我找到了git-crypt,但是在站点上提到它是用于单个文件加密的。如果要加密整个存储库,则将它们转发到git-remote-gcrypt。
git-remote-gcrypt
在他们的README.rst文件中,它就像
快速开始
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
或以下
例子
# 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
尝试
我更喜欢完整的存储库加密,因此尝试git-remote-gcrypt
使用Quickstart和Example的变体。到目前为止,我已经按照他们的指示尝试推送现有的存储库。结果如下:(注意:我故意将用户名更改为user
)
-> ssh
如提供的示例中所示
[...]/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'
或与https
(有效)
[...]/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.
但是,我不知道如何添加用户,甚至不知道将备份拉到另一台计算机上(因为我的gpg密钥是在本地生成的)!请随意回答的用法git-remote-gcrypt
。