简体   繁体   中英

Not able to connect GIT through SSH from Eclipse

I am trying to connect GIT repository from eclipse. If I use GIT protocol then I can able to pull the files. But when I trying to connect through ssh protocol I am getting below issue.

org.eclipse.jgit.api.errors.TransportException: ssh://username@localhost:8001/Repo: verify: false
    at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:223)
    at org.eclipse.jgit.api.LsRemoteCommand.call(LsRemoteCommand.java:161)
    at org.eclipse.egit.core.op.ListRemoteOperation.run(ListRemoteOperation.java:114)
    at org.eclipse.egit.ui.internal.clone.SourceBranchPage$8.run(SourceBranchPage.java:335)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Caused by: org.eclipse.jgit.errors.TransportException: ssh://username@localhost:8001/Repo: verify: false
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:172)
    at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:140)
    at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:280)
    at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:170)
    at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:200)

Caused by: com.jcraft.jsch.JSchException: verify: false
    at com.jcraft.jsch.Session.connect(Session.java:330)
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:126)

I tried adding http.sslverify=false in Git Configuration, adding .git at the end of the URL. But still the issue is not resolved.

Please let me to resolve the issue.

If you are connecting to "localhost", then you don't need ssh.
Use the file or " local protocol "

cd /path/to/my/repo
git remote set-url origin /home/username/Repo.git

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM