我知道如何通过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
...但是,如何在同一个文件中同时使用它们?
即使在存储在 LFS 上的过滤器之前有用于加密.gitattributes
的git-filter,文件也不会被加密(报告“未加密”)。LFS 未跟踪的所有其他文件都会正确加密。git crypt status | grep somethingTo
*.crypt.*
我想问题在于我somethingTo.crypt.txt
现在只是存储库中的一个参考对象,而不是实际的(加密的)文件。但我希望(感谢git-filter
s)文件在被推送到LFS Store之前被过滤/加密。
这两个过滤器扩展是否相互兼容?我如何让它们一起工作?