Search code examples
gitmacosfatal-erroratlassian-sourcetreeosx-elcapitan

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


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!


Solution

  • 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!