Search code examples
xcodegitsshxcode4gitosis

Using a gitosis git repository with XCode 4


Hi I've been trying to access my git repository from XCode 4.

Everything works just fine using the command line tools. I can clone my repo using:

git clone [email protected]:somerepo.git

But in XCode, when trying to use:

ssh://[email protected]:somerepo.git

It just keeps asking me for a password, which I don't want to use at all.

The same thing happens with:

git://[email protected]:somerepo.git

Except that i also get a "Connection refused: unable to connect to a socket" error message.

Any idea how to solve this?


Solution

  • In Xcode 4.2, the following location string worked for me

    ssh://[email protected]:22/somerepo.git
    

    The ssh:// part is required to tell Xcode which protocol should be used. Since the URL now contains a scheme, the port :22 specifier is also required to make Git happy. Without the port, I got the following (weird) error message on the command line: "ssh: connect to host port 22: Connection refused".

    By the way: When I added my repository in the Organizer window, Xcode mumbled something about "authentication is needed", then started to spin an activity indicator. Although I was able to clone the repo immediately, I had to restart Xcode to get rid of the activity indicator.