在执行 git push
时,我正在努力让 git 记住我的用户名/密码到 gitlab 存储库(我假设 Github 存储库也会发生同样的问题)。每次都输入用户名/密码让我抓狂。
当我这样做时git config --global credential.helper osxkeychain
它毫无问题地接受它。
但是当我实际执行 git push
时我得到 --> git: 'credential-osxkeychain' is not a git command. See 'git --help'.
由于包兼容性问题,我激活了 conda 环境,因此可以使用 python 3.6。当我这样做时conda list
我看到 git 列出了。但是,当我执行 conda search
时对于 osxkeychain 我没有得到任何结果。我通过xcode-select --install
安装了xcode
如果我停用 conda 环境,那么它就像一个 super 按钮一样工作,并且必须保存之前的密码,因为它甚至不会要求我提供任何凭据。只是 push ,就像它知道自己在做什么一样。
最佳答案
我可以确认此行为。似乎 git
的 Anaconda 版本无法编译 the osxkeychain
credential module 。幸运的是,the Conda Forge one does ,所以我想说最简单的解决方案可能是
conda install conda-forge::git
安装后,重新运行配置命令
git config --global credential.helper osxkeychain
关于python - Conda环境不会在git中存储gitlab密码(Mac),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58403189/