【问题标题】:Git commit "error: Could not connect to socket. Is the agent running? fatal: failed to write commit object" after reverting from 1password ssh-agentGit commit \"error: Could not connect to socket. Is the agent running? fatal: failed to write commit object\" 从 1password ssh-agent 恢复后
【发布时间】:2022-12-22 02:16:57
【问题描述】:

在任何地方都找不到这个问题的答案,但终于找到了问题所在并想分享解决方案。
问题:使用 1Password ssh 代理后,尝试通过 Mac 上的终端"git commit" 会产生以下错误:Could not connect to socket。代理在运行吗?
fatal: failed to write commit object
解决方案: 1Password 修改了两个文件,其中指定了使用哪个 ssh; ~/.gitconfig and ~/.ssh/config

删除作为默认 ssh 代理的 1Password 后,这两个文件也必须还原。
~/.ssh/config删除 主持人 * IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
~/.gitconfig换 [gpg“ssh”] program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign 到您的 ssh /usr/bin/ssh 的默认路径

此解决方案适用于命令行 git 和 GitHub 桌面客户端。

【问题讨论】:

  • 这对我很有帮助!作为一个温和的建议,您可能希望将解决方案移动到您自己的问题的答案中:)

标签: git macos ssh 1password


【解决方案1】:

以下内容适用于 Linux 操作系统。 MacOs 类似

  1. 删除以下行
    Host *
        IdentityAgent ~/.1password/agent.sock
    

    来自 ~/.ssh/config 文件

    1. 删除以下行
    [gpg "ssh"]
      program = "/opt/1Password/op-ssh-sign"
    

    来自 ~/.gitconfig 文件

【讨论】:

    【解决方案2】:

    我注意到我的 1Password 没有运行。所以我启动了我的 1Password 应用程序,它立即运行。

    【讨论】:

      猜你喜欢
      • 2016-03-05
      • 2019-07-29
      • 1970-01-01
      • 1970-01-01
      • 2017-03-29
      • 2021-12-09
      • 1970-01-01
      • 2021-06-16
      • 2018-07-30
      相关资源
      最近更新 更多