-
Notifications
You must be signed in to change notification settings - Fork 483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git worktree add
in repo with encrypted commited file made encrypted fails.
#105
Comments
I'm also experiencing this behaviour. It seems that there can be only one decrypted worktree:
It would be nice if git crypt supported multiple workspaces or at least show some better error message. |
@stefan-improbable the reason I made a simple patch to fix your issue (my issue too), which works for me. I can freely
|
@ckyoog I've tried your patch, but then the command |
@ckyoog thanks, your patch seems to work for me! @icy you may be using and old git client that doesn't support |
@ckyoog would you please submit that patch as a PR? |
I will try again. If the patch requires new git, it would have some checks or warning that would be very helpful. Thx |
@ckyoog I have the issue with (hopefully) new git as below
|
could you try moving the filters from .git/config to .git/config.worktree |
Thanks a lot. My mistake, I should have executed I confirm @ckyoog's patch is working . Thanks a ton. |
It could be great if we can have this feature, I'm having the same issue |
This seems to work around the issue (even without the patch):
|
Copying configuration doesn't seem great as keeping it in sync will be problematic.
|
@starsep yep, that works as well. |
Any news on a proper fix? worktrees are absolutely integral part of git. |
Base on @ckyoog 's patch, I make a build here https://github.com/maxisam/git-crypt/actions/runs/11785641038 with this path we can lock and unlock worktree independently. But we still need to lock the repo before or you will get error like. Preparing worktree (new branch 'test-wt-2')
git-crypt: Error: Unable to open key file - have you unlocked/initialized this repository yet?
error: external filter '"C:\\Program Files\\Git\\cmd\\git-crypt.exe" smudge' failed 1
error: external filter '"C:\\Program Files\\Git\\cmd\\git-crypt.exe" smudge' failed
fatal: secretfile: smudge filter git-crypt failed not sure how to get around it |
found a fix to add worktree in unlock status from PR #222 This build should handle everything nicely https://github.com/maxisam/git-crypt/actions/runs/11787683064 |
I've tested this on debian jessie, with
git/testing
(2.11.0-1) fromhttp://ftp.us.debian.org/debian/ testing/main amd64 Packages
.What I observe is,
git worktree add
's failure behavior falls into, what I get the impression to be, a large range of compatibility problems that stem from having a previously committed file with the same path as a current encrypted file. I'm curios if a.gitcryptignore
and.git/info/gitcryptignore
type file to list files for which the error condition triggered for "an older version of this file may be unencrypted in the repository's history." does not interrupt git plumbing commands.Its a bit annoying that all worktree's have to independently be decrypted; maybe a feature to apply lock/unlocks across all work trees would be a nice configuration option to add.
git config --global gitcrypt.globalworktreelockstate true
kinda thing.The text was updated successfully, but these errors were encountered: