我试过以下说明:https://stackoverflow.com/a/40312117/21728基本上做到这一点:如何在WSL上使用Git凭证存储(Windows上的Ubuntu)?
sudo apt-get install libsecret-1-0 libsecret-1-dev
cd /usr/share/doc/git/contrib/credential/libsecret
sudo make
git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
但是当我做任何网络操作,我得到这个错误:
** (process:7902): CRITICAL **: could not connect to Secret Service: Cannot autolaunch D-Bus without X11 $DISPLAY
这是合乎逻辑的我猜的有确实没有X11显示器。
如何使Git证书在Windows上的Ubuntu上工作(WSL)?
这是关于Windows的Windows子系统(WSL),而不是MSysGit。您无法在WSL内部安装Git for Windows。 –
好的,你不能安装,但你可以使用WSL的windows可执行文件,所以你可以使用git上的凭证助手来运行WSL上的git。这个配置是从我自己的机器上复制的。 –
'git config --global credential.helper“/ mnt/c/Program \ Files/Git/mingw64/libexec/git-core/git-credential-wincred.exe”'这是我使用的命令。如果你有一个空间的路径,你需要转义它,并把它放在引号中。 – masters3d