问题
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.
- Stop sshd.
sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
- Edit
/etc/ssh/sshd_config
and insert this line.KexAlgorithms diffie-hellman-group1-sha1
- 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