无法使用 SourceTree 连接到 El Capitan 上的 git 存储库

Can't connect to git repo on El Capitan with SourceTree

我正在使用 Mac 来托管我们的代码,它被设置为 git 存储库,并使用 SourceTree 在 [=28] 上执行我的推送、拉取等操作=] 7. 直到最近,这工作正常,但是自从将 Mac 上的 OS 更新为 El Capitan 后,SourceTree 不再希望推送。

我使用public key/private密钥认证,repo url格式为:

ssh://user@IPAddress/path

如果我尝试使用 PuTTy 连接,没有问题 - 选美 运行,并且似乎正在做它的事情。

当我尝试推送到 SourceTree 中的存储库时,它会尝试几分钟,然后出现以下错误:

FATAL ERROR: Server unexpectedly closed network connection

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我之前没有遇到任何问题,Mac 上的设置也没有任何变化,只是更新了 OS.

我不明白为什么我能够连接 PuTTy。非常感谢任何帮助!

我需要在 Mac Mini 上重新安装 XCode 开发者工具。

我登录并 运行

xcode-select --install

之后,推送成功。

希望对大家有所帮助!

我换个方法解决了

  1. 停止 sshd。
    sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
  2. 编辑 /etc/ssh/sshd_config 并插入这一行。
    KexAlgorithms diffie-hellman-group1-sha1
  3. 重启 sshd。
    sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist