【发布时间】:2017-08-19 19:18:15
【问题描述】:
The git-crypt instructions exist for Linux and MacOS,但对于 Windows,这些似乎被省略了。如何在 Windows 上安装 Git-crypt?
【问题讨论】:
The git-crypt instructions exist for Linux and MacOS,但对于 Windows,这些似乎被省略了。如何在 Windows 上安装 Git-crypt?
【问题讨论】:
还有其他方法,但我喜欢msys2:
安装msys2:
打开一个 msys2 终端。那么……
按照此处的说明安装 g++ for windows:
https://github.com/orlp/dev-on-windows/wiki/Installing-GCC--&-MSYS2
确保 /mingw64/bin 在您的路径中。 (例如哪个 g++)
git clone git@github.com:AGWA/git-crypt
cd git-crypt
制作 LDFLAGS="-static-libstdc++ -static -lcrypto -lws2_32"
【讨论】:
C:\msys64\usr\local\bin 添加到我的路径中,以便新的git-crypt 可执行文件在cmd/powershell 中可用。这也使其可用于 Android Studio(这是我的用例)
git clone https://github.com/AGWA/git-crypt.git - 否则 git 会抱怨克隆它的权限被拒绝。
make LDFLAGS="-static-libstdc++ -static -lcrypto.dll" 否则,您必须将两个 dll "libstdc++-6.dll" und "libcrypto-1_1-x64.dll" 放在旁边在 msys2 之外执行它的可执行文件
查看git crypt for Windows。考虑您是否信任来自互联网的未签名文件(请记住 git crypt 本身是未签名的,您可能还没有查看源代码)
【讨论】:
我不相信提到的存储库git crypt for Windows。
我终于设法自己构建了 git-crypt。而且这两个二进制文件的大小差异很大。
我的自编译版本大约为 370 kb,而 GitHub 上的版本为 5.7 Mb。
感谢您的回答 竖起大拇指
【讨论】:
我从here 下载了 git-crypt.exe 并将其放在 C:\Program Files\Git\cmd\git-crypt.exe 中!这解决了我的问题!
【讨论】:
对于 Windows 10,有一个替代方案可以使用 WSL(适用于 Linux 的 Windows 子系统)使事情变得更容易一些。这将避免编译任何东西的需要。
如果您没有启用 WSL,请参阅 Microsoft docs guide。我还建议从 Microsoft Store 应用程序安装最新的 LTS 版本的 Ubuntu(任何版本的 Ubuntu 都可以)。
安装 Git Crypt
一旦您拥有适用于 WSL 的 Ubuntu 工作副本,请打开它并运行以下命令。
sudo apt-get update
sudo apt-get install git-crypt gnupg
使用 Git Crypt
现在您需要做的就是通过查看/mnt/ 在 Ubuntu 中访问您的 Windows 文件。然后你可以在 WSL 中照常使用 git-crypt。
【讨论】:
使用 msys2 你可以:-
pacman -S git-crypt
无需构建即可安装。
【讨论】: