I am performing a sparse checkout on a git dir that uses git-crypt.
A normal git clone followed by a git-crypt unlock works.
Since I am running a sparse checkout, I would also like to perform a partial git-crypt unlock
After running
g sparse-checkout init
g sparse-checkout add <dir1>
g checkout master
g sparse-checkout add <dir2>
g checkout master
NOTE: g sparse checkout <dir1> <dir2 followed by g checkout master does not work as it seems to fetch only <dir2>
I run git-crypt unlock
This however fails miserably since it spits out a ton of errors as in
error: pathspec 'path/to/some/other/encrypted/file/not/included/in/my/sparse/checkout' did not match any file(s) known to git
Any suggestions how to deal with this?
There is no direct solution to this.
Something that can be done about it is using multiple keys from git crypt, a key for each sparse checkout and another key for the overall encryption.
Docs: https://github.com/AGWA/git-crypt/blob/master/doc/multiple_keys.md
Alternative solution and source of my information: https://github.com/AGWA/git-crypt/issues/155
The best solution is using multiple keys at the moment.