python - Conda环境不会在git中存储gitlab密码(Mac)

标签 python git macos anaconda conda

在执行 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/

相关文章:

python - 如何在 ubuntu 14 中安装 aws-sam-cli?

git - 将配置参数保存到存储库

git - 如何在没有互联网连接的情况下在 ubuntu 上提取 git 存储库?

macos - 带有 iterm 2 的 zsh 无法识别我的别名

macos - 思科如何为 Outlook mac 集成 webex 插件

python - 使用数据访问层和应用层时的 TDD 方法

python - 折叠 Pandas 数据框数据集中的行

python - 如何将对话框按钮链接到主窗口功能并使关闭事件与功能分开

git - 如何将未提交的工作移到错误的 Git 分支上?

python-3.x - 将表格复制到剪贴板