【发布时间】:2021-02-05 19:29:51
【问题描述】:
我知道如何通过 git-crypt 加密我的存储库中的文件:
echo "*.crypt.* filter=git-crypt diff=git-crypt" > .gitattributes
echo "supersecret info" > somethingTo.crypt.txt
git add .gitattributes somethingTo.crypt.txt
git crypt status # somethingTo.crypt.txt results encrypted
git commit
git push
我知道如何使用 git-lfs 存储文件(在自托管 GitLab 上;在项目设置中启用 LFS):
git lfs track somethingTo.crypt.txt
git add .gitattributes # updated LFS rule for tracked file
git commit
git push
...但是,如何在同一个文件中同时使用它们?
即使.gitattributes 有 git-filter 用于加密 在 用于存储在 LFS 上的过滤器,文件也不会被加密(git crypt status | grep somethingTo 报告“未加密”)。所有其他未被 LFS 跟踪的 *.crypt.* 文件都被正确加密。
我想问题在于我的somethingTo.crypt.txt 现在只是存储库中的一个引用对象,而不是实际的(加密的)文件。但我希望(感谢git-filters)文件在被推送到LFS Store之前被过滤/加密。
这两个过滤器扩展是否相互兼容?如何让它们协同工作?
【问题讨论】:
标签: git encryption git-lfs git-filter git-crypt