AGWA / git-crypt

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

Cannot unlock with submodules in the repository #261

Closed eggbean closed 2 years ago

eggbean commented 2 years ago

I cannot unlock because of the working "directory not being clean", due to submodules. Obviously they cannot be stashed.

$ git crypt unlock
Error: Working directory not clean.
Please commit your changes or 'git stash' them before running 'git-crypt unlock'.
$ git stash push
No local changes to save
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   submodule1 (new commits)
        modified:   submodule2 (new commits)

no changes added to commit (use "git add" and/or "git commit -a")

Admittedly I am new to submodules and still don't fully understand how they work and find it a little confusing. How do I unlock in this situation?

eggbean commented 2 years ago

I don't know what I did wrong, but I have re-cloned the repository and the submodules and it's working okay now and I can unlock without any problems. Therefore it isn't a problem with git-crypt - I made a mistake with the submodules somehow.