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

百般思念 提交于 2019-12-13 08:42:30

问题


I'm using a Mac to host our code, which is set up as a git repository, and performing my push, pull, and so on with SourceTree, on Windows 7. Up until recently, this was working fine, however since updating the OS on the Mac to El Capitan, SourceTree no longer wants to push.

I use public key/private key authentication, and the repo url is of the format:

ssh://user@IPAddress/path

If I try to connect using PuTTy, there is no problem - pageant is running, and seems to be doing its thing.

When I try to push to the repo in SourceTree, it tries for a couple of minutes, and then I get the following error:

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.

I haven't had any problems previously, and there have been no changes to the set up on the Mac, just the updated OS.

I can't see why I would be able to connect with PuTTy. Any help is greatly appreciated!


回答1:


I'm solved it by another way.

  1. Stop sshd.
    sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
  2. Edit /etc/ssh/sshd_config and insert this line.
    KexAlgorithms diffie-hellman-group1-sha1
  3. Restart sshd.
    sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist



回答2:


I needed to reinstall the XCode developer tools on the Mac Mini.

I logged in and ran

xcode-select --install

after which, the push was successful.

I hope this helps someone!



来源:https://stackoverflow.com/questions/33299615/cant-connect-to-git-repo-on-el-capitan-with-sourcetree

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!