AGWA / git-crypt

Transparent file encryption in git
https://www.agwa.name/projects/git-crypt/
GNU General Public License v3.0
8.18k stars 475 forks source link

Unable to do "git crypt unlock" #139

Closed sivaraam closed 6 years ago

sivaraam commented 6 years ago

I recently encrypted certain files using git crypt. I typically did the following to encrypt the files,

$ git crypt init
$ git crypt add-gpg-user GPG_UID
$ vi .gitattributes
$ git add .gitattributes
$ git rm --cached <secret-files...>
$ git add <secret-files...>
$ git commit

Then I cloned the repository to another location on the same system.

$ cd new_loc
$ git clone /path/to/repo-with-secret-files
$ cd repo-with-secret-files

Then I tried to unlock them using

$ git crypt unlock

I consistently get,

Error: no GPG secret key available to unlock this repository.
To unlock with a shared symmetric key instead, specify the path to the symmetric key as an argument to 'git-crypt unlock'.

What am I missing?

NOTE: I already saw #135 but it wasn't helpful in my case.

Other info:

$ git --version
git version 2.16.0.312.g896df04e4
$ git crypt --version
git-crypt 0.6.0

git was built from the 'next' branch of the git source tree and git-crypt was built from the 'master' branch.

uioporqwerty commented 6 years ago

@sivaraam were you ever able to resolve this issue? I'm experiencing a similar issue. Private key added to gpg but git-crypt says there isn't one available.

sivaraam commented 6 years ago

@uioporqwerty Actually no. I was just trying to see if git-crypt worked for what I wanted to achieve. Given that I couldn't even set it up correctly to decrypt it at least once, I gave up.

nicolaiskogheim commented 6 years ago

I thought I had the same problem, but as it turned out, I just hadn't pulled down the commit where the key I wanted to use was added.

sivaraam commented 6 years ago

I couldn't reproduce the issue now.