Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Unable to clone from ssh repositories #640

Closed
wadxm opened this issue Jan 14, 2018 · 7 comments
Closed

[iOS] Unable to clone from ssh repositories #640

wadxm opened this issue Jan 14, 2018 · 7 comments

Comments

@wadxm
Copy link

wadxm commented Jan 14, 2018

Hi, I'm trying to clone from a ssh repository with objective-git, but it failed with an "unsupported URL protocol" error, here's my code:

NSError *error; GTRepository *repo = [GTRepository cloneFromURL:[NSURL URLWithString:@"ssh://[email protected]/xxx"] toWorkingDirectory:directoryPath options:nil error:&error transferProgressBlock:nil];

After running, repo will be nil and here is the content of error:

Error Domain=GTGitErrorDomain Code=-1 "Failed to clone repository from ssh://[email protected]/ugc/AWELocalizations to file:///var/mobile/Containers/Data/Application/6BEF1FF1-94DB-4D01-8AD9-EA1E51937195/Documents/AWELocalizations" UserInfo={NSLocalizedDescription=Failed to clone repository from ssh://[email protected]/ugc/AWELocalizations to file:///var/mobile/Containers/Data/Application/6BEF1FF1-94DB-4D01-8AD9-EA1E51937195/Documents/AWELocalizations, NSUnderlyingError=0x1d40562c0 {Error Domain=GTGitErrorDomain Code=-1 "unsupported URL protocol" UserInfo={NSLocalizedDescription=unsupported URL protocol}}}

I'm wondering what's wrong with my configurations, thanks a lot :-)

@tiennou
Copy link
Contributor

tiennou commented Jan 15, 2018

This error message usually means libssh2 (which is what libgit2 uses for SSH transport) is not available.

@Maxwin-z
Copy link

the same error, how to fix it?

@tiennou
Copy link
Contributor

tiennou commented Feb 13, 2018

You need to compile libgit2 with SSH support enabled, which entails having libssh2 installed as well. Normally ./script/bootstrap & ./script/update_libgit2 are the scripts that take care of setting up dependencies.

@wadxm
Copy link
Author

wadxm commented Feb 13, 2018

I have tried recompiling libssh2 but the error still occurs, so finally I directly download the complied framework and embed this one in my project

@tiennou
Copy link
Contributor

tiennou commented Feb 13, 2018

Strange… Can you check the output of git_libgit2_features to make sure the SSH support is enabled in your build ?

@Maxwin-z
Copy link

As @wadxm mentioned, I use Carthage embed the framework, and fixed the problem.

@tiennou
Copy link
Contributor

tiennou commented Mar 1, 2018

Glad to hear you've got it working. #643 has updated libssh2 to 1.8.0, which works against the "new" GitHub cryptosuite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants